Skip to content

Instantly share code, notes, and snippets.

@dmwit
Created August 26, 2019 00:53
Show Gist options
  • Save dmwit/062f38fa6898e4c009b0aa381bf7949d to your computer and use it in GitHub Desktop.
Save dmwit/062f38fa6898e4c009b0aa381bf7949d to your computer and use it in GitHub Desktop.
> mapM_ (print . pretty) $ runInfer (SourceApp (SourceApp (SourceVar "plus") (SourceVar "readLn")) (SourceVar "readLn"))
let appPMPPM f x = pure (f (pure x))
appMaMaM f x = f >>= ($x)
appMMMPM f x = f >>= ($pure x)
appMPMMM f x = f >>= (x>>=)
appMaPaM f x = fmap ($x) f
appMMPPM f x = fmap ($pure x) f
in
(<*>) (fmap plus readLn) readLn
:: m _
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment