0

Using a different Prelude results in <<type not presentable>> error

Even though a different prelude is used that exports Show and related show implementations, Haskell for Mac is unable to present values that implement Show.

This problem is demonstrable by doing the Monad Challenges (http://mightybyte.github.io/monad-challenges/).

The solution Haskell files all start with (for example):

{-# LANGUAGE MonadComprehensions #-}
{-# LANGUAGE RebindableSyntax #-}

module Set1 where

import MCPrelude

I copied MCPrelude into Haskell for Mac so it can be imported.

(attempts to import it directly from GitHub in the cabal file were unsuccessful)

Here is an example that shows the problem:

{-# LANGUAGE MonadComprehensions #-}
{-# LANGUAGE RebindableSyntax #-}

module Set1 where

import MCPrelude

fiveRands :: [Integer]
fiveRands = take 5 $ drop 1 $ map fst $ iterate (\(_, seed) -> rand seed) (0, mkSeed 1)

Then type `fiveRands` into the playground and you see:

«type not presentable»  [Integer]

... even though both List and Integer implement Show.

3 comments

Please sign in to leave a comment.