Skip to content

Instantly share code, notes, and snippets.

@kuribas

kuribas/bug.hs Secret

Created September 5, 2021 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kuribas/9bf506b79dd2690600c4c06108efae59 to your computer and use it in GitHub Desktop.
Save kuribas/9bf506b79dd2690600c4c06108efae59 to your computer and use it in GitHub Desktop.
applicative bug
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ApplicativeDo #-}
module ApplicativeDont (foo) where
data M a
data N a
instance Functor M
instance Applicative M
instance Functor N
instance Applicative N
instance Monad N
newtype Alias = Alias (forall a. a -> M a)
foo :: N (M ())
foo = do
pure ()
Alias mt <- undefined
pure ()
pure $ (\c b -> ()) <$> mt 'a' <*> mt False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment