diff options
author | Joe Zhao <ztuowen@gmail.com> | 2015-04-06 19:37:51 +0800 |
---|---|---|
committer | Joe Zhao <ztuowen@gmail.com> | 2015-04-06 19:37:51 +0800 |
commit | 3cf3e36b1498271f3c9162576809d886482e6d97 (patch) | |
tree | 783fb036751d95b0b5fe2e4cb21d45a5dc2660e9 | |
parent | 36a645180f3ef13126c06b957d76c729f62d41fd (diff) | |
download | typeclass-3cf3e36b1498271f3c9162576809d886482e6d97.tar.gz typeclass-3cf3e36b1498271f3c9162576809d886482e6d97.tar.bz2 typeclass-3cf3e36b1498271f3c9162576809d886482e6d97.zip |
11
-rw-r--r-- | applicative/h11.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/applicative/h11.hs b/applicative/h11.hs new file mode 100644 index 0000000..54eb02d --- /dev/null +++ b/applicative/h11.hs @@ -0,0 +1,6 @@ +-- http://stackoverflow.com/questions/23316255/lax-monoidal-functors-with-a-different-monoidal-structure +pure a = fmap (const a) unit +unit = pure () + +ff <*> fa = fmap (\(f,a) -> f a) $ ff ** fa +fa ** fb = pure (,) <*> fa <*> fb |