Last active
August 29, 2015 14:13
-
-
Save edwinb/1bd96cb729774dd382ef to your computer and use it in GitHub Desktop.
Scoped implicits and type classes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AnyST : Type -> Type -> Type | |
AnyST s a = {m : _} -> Monad m => StateT s m a | |
foo : AnyST Integer () | |
foo = do x <- get | |
put (x + 1) | |
wibble : StateT Integer Maybe () | |
wibble = foo | |
appShow : Show a => ({b : _} -> Show b => b -> String) -> a -> String | |
appShow s x = s x | |
myshow : Show a => a -> String | |
myshow = show | |
bar : Int -> String | |
bar x = appShow myshow x | |
bar' : Int -> String | |
bar' x = appShow show x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment