NoStarIsType

https://haskell.e-bigmoon.com/posts/2019/10-04-nostaristype

Memo

λ ghc -V
The Glorious Glasgow Haskell Compilation System, version 8.8.1

λ :k *
* :: *

λ :set -XNoStarIsType
λ :k *
<interactive>:1:1: error:
    Operator applied to too few arguments: *
    With NoStarIsType, ‘*’ is treated as a regular type operator. 
    Did you mean to use Type from Data.Kind instead?
    
λ import Data.Kind
λ :k Type
Type :: Type

λ :set -XTypeOperators
λ import GHC.TypeLits
λ :k 10*10
10*10 :: Nat
λ :kind! 10*10
10*10 :: Nat
= 100

参考リソース

Last updated