[Haskell-cafe] Can't get Type 3" to work
Brandon Allbery
allbery.b at gmail.com
Mon Dec 3 00:12:22 UTC 2018
That looks like someone had a search-and-replace error.
It used to be that the kind of normal values was *. Type level math made
this problematic; by default, in recent ghc that kind is called Type
instead. (See the StarIsType LANGUAGE pragma.)
So someone did a search and replace to fix the kinds, and changed what
should have been a type level multiplication by accident. Change it to a*.
On Sun, Dec 2, 2018 at 7:09 PM Amy de Buitléir <amy at nualeargais.ie> wrote:
> I'm reading "Thinking with Types" by Sandy Maguire, and there's a bit of
> code on p. 27 that I don't understand and can't get to work. The "Type 3"
> seems to have the effect of multiplying by 3.
>
> > :set -XDataKinds
> > :set -XTypeOperators
> > :kind! (1 + 17) Type 3
>
> (1 + 17) Type 3 :: Nat
> = 54
>
> But it doesn't work for me. When I try this, I get...
>
> $ ghci --version
> The Glorious Glasgow Haskell Compilation System, version 8.2.2
>
> $ ghci
>
> λ> :set -XDataKinds
> λ> :set -XTypeOperators
> λ> :kind! (1 + 17) Type 3
>
> <interactive>:1:2: error:
> Not in scope: type constructor or class ‘+’
>
> <interactive>:1:10: error:
> Not in scope: type constructor or class ‘Type’
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.
--
brandon s allbery kf8nh
allbery.b at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20181202/145fbce7/attachment.html>
More information about the Haskell-Cafe
mailing list