Il giorno 13 feb 2016, alle ore 10:15, Christopher Allen <cma@bitemyapp.com> ha scritto:>subtle difference means that you do need to know about this due to how stacks work in GHC. If you use error and then don't also add that constraint yourself to your function, youll only see part of the stack.It is unfortunate that the design forces this implementation detail on users trying to apply a plain old function.I updated my GHC 8.0.1 candidate, got this:$ ghciLoaded GHCi configuration from /home/callen/.ghciPrelude> let myList = [1..5 :: Integer]Prelude> let myList' = myList ++ undefinedPrelude> :t myList'myList' :: (?callStack::GHC.Stack.Types.CallStack) => [Integer]> changed to use constraint kinds and type alias the implicit parameter behind a nicer API.Even if this has happened, we're still talking about the fourth chapter which is prior to types, typeclasses, constraints - everything. None of this means anything to a beginner being shown how to use undefined. The book is trying to make sure _anyone_ can learn Haskell, it's not an advanced DSLs book that introduces DataKinds.The implementation is leaking all the way to the fourth chapter of a book for complete beginners. Users will not be sympathetic when the implementation elides information because the user failed to speak to the nasal demons in the correct accent.Hi Christopher, I’m following your painful experience preparing the book for GHC 8.0,and I sympathize with you.Just a question: how do you manage the type of simplearithmetic expressions like 1 + 1? I mean, the type contains a constraint there.
Teaching ‘undefined’ to beginners is not essential.