'Import the * operator of type level naturals
Follow-up to Import a type family that is an operator in Haskell.
This works:
import GHC.TypeLits (type (+))
This is a parse error in GHC 9.0:
import GHC.TypeLits (type (*))
See for example:
ghci -XTypeOperators
GHCi, version 9.0.2: https://www.haskell.org/ghc/ :? for help
ghci> import GHC.TypeLits (type (+))
ghci> import GHC.TypeLits (type (*))
<interactive>:2:28: error: parse error on input ‘*’
How do I import type level natural number multiplication?
Solution 1:[1]
It is necessary to activate the language extension NoStarIsType
, then it will work. Otherwise, *
is going to be interpreted as Type
.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Turion |