Skip to content

Flipping (give :: a -> (Given a => r) -> r) has type (r -> a -> r)

give from the reflection library has the following type

give :: forall a r. a -> (Given a => r) -> r 

but flip give :: r -> a -> r!

Same happens with our own Given, give

$ ghci -ignore-dot-ghci -XRankNTypes
GHCi, version 8.3.20170605: http://www.haskell.org/ghc/  :? for help
Prelude> class Given a
Prelude> give :: a -> (Given a => r) -> r; give = undefined
Prelude> :t flip give
flip give :: c -> a -> c
Prelude> 
Edited by Icelandjack
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information