+----------------------+--------------------+--------------------+--------------------+
| Operation | F-Sharp | Compability | Haskell |
+======================+====================+====================+====================+
| List.append | @ | | ++ |
+----------------------+--------------------+--------------------+--------------------+
| Function composition | f << g | f . (g) | f . g |
+----------------------+--------------------+--------------------+--------------------+
| | = | == | == |
+----------------------+--------------------+--------------------+--------------------+
| | <| | $ | $ |
+----------------------+--------------------+--------------------+--------------------+
| | <> | =/ | /= |
+----------------------+--------------------+--------------------+--------------------+
| flip | /> | | |
+----------------------+--------------------+--------------------+--------------------+
| apply function to | </ or |> | not available | not available |
| a value | | in Haskell | in Haskell |
+----------------------+--------------------+--------------------+--------------------+
| | | | |
+----------------------+--------------------+--------------------+--------------------+
| Functors |
+----------------------+--------------------+--------------------+--------------------+
| map | <!> or <<| | <!> or fmap | <$> or fmap |
+----------------------+--------------------+--------------------+--------------------+
| map with | | | |
| interchanged | |>> | | |
| arguments | | | |
+----------------------+--------------------+--------------------+--------------------+
| | | | |
+----------------------+--------------------+--------------------+--------------------+
| Monoids |
+----------------------+--------------------+--------------------+--------------------+
| zero element | zero | mempty | mempty |
+----------------------+--------------------+--------------------+--------------------+
| append | ++ or plus | mappen | mappend |
+----------------------+--------------------+--------------------+--------------------+
| | | | |
+----------------------+--------------------+--------------------+--------------------+
| Applicative functors |
+----------------------+--------------------+--------------------+--------------------+
| apply (combine) | <*> | <*> | <*> |
+----------------------+--------------------+--------------------+--------------------+
| Sequence actions | | | |
| and discard values | *> | *> | *> |
| of first argument | | | |
+----------------------+--------------------+--------------------+--------------------+
| Sequence actions | | | |
| and discard values | <* | <* | <* |
| of second argument | | | |
+----------------------+--------------------+--------------------+--------------------+
| A variant of <*> | | | |
| with the arguments | <**> | <**> | <**> |
| reversed. | | | |
+----------------------+--------------------+--------------------+--------------------+
| Lift a value. | result | pure' | pure |
+----------------------+--------------------+--------------------+--------------------+
| | | | |
+----------------------+--------------------+--------------------+--------------------+
| Alternatives |
+----------------------+--------------------+--------------------+--------------------+
| binary operation | | <|> | <|> |
+----------------------+--------------------+--------------------+--------------------+
| | | | |
+----------------------+--------------------+--------------------+--------------------+
| Monads |
+----------------------+--------------------+--------------------+--------------------+
| Bind sequentially | | | |
| compose two actions, | | | |
| passing any value | | >>= | >>= |
| produced by the | | | |
| first as an argument | | | |
| to the second. | | | |
+----------------------+--------------------+--------------------+--------------------+
| Bind with | | | |
| interchanged | | =<< | =<< |
| arguments. | | | |
+----------------------+--------------------+--------------------+--------------------+
Forked from gusty/fsharpplus_haskell_compatibility.md
Last active
March 7, 2018 12:26
-
-
Save ShalokShalom/11cf9b1943d36ac51939e83bb0fced84 to your computer and use it in GitHub Desktop.
Haskell operator compatibility layer for F-Sharp
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment