|
can't derive Monad: msg#00077lang.haskell.glasgow.bugs
The following may not be a bug, but it surprised me. Why does the circularity cause GHC fits? swan(106)% cat NestStateT.hs {-# OPTIONS -fglasgow-exts #-} import Control.Monad.State newtype S1 = S1 [T1 ()] newtype T1 a = T1 (StateT S1 IO a ) deriving Monad main = undefined swan(105)% ghci NestStateT.hs ___ ___ _ / _ \ /\ /\/ __(_) / /_\// /_/ / / | | GHC Interactive, version 5.04.3, for Haskell 98. / /_\\/ __ / /___| | http://www.haskell.org/ghc/ \____/\/ /_/\____/|_| Type :? for help. Loading package base ... linking ... done. Loading package haskell98 ... linking ... done. Compiling Main ( NestStateT.hs, interpreted ) NestStateT.hs:6: Can't make a derived instance of `Monad T1' (too hard for cunning newtype deriving) When deriving instances for type `T1' Failed, modules loaded: none. Prelude>
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | [ ghc-Bugs-779150 ] ghci panics, SourceForge.net |
|---|---|
| Next by Date: | RE: can't derive Monad, Simon Peyton-Jones |
| Previous by Thread: | [ ghc-Bugs-779150 ] ghci panics, SourceForge.net |
| Next by Thread: | RE: can't derive Monad, Simon Peyton-Jones |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |