Open tscholak opened 5 years ago
You can extend this function to get the behavior you want: https://github.com/clash-lang/ghc-typelits-extra/blob/14b52940d30172aee1c315dbc9868c0314017e99/src/GHC/TypeLits/Extra/Solver/Operations.hs#L145
Extend https://github.com/clash-lang/ghc-typelits-extra/blob/14b52940d30172aee1c315dbc9868c0314017e99/src/GHC/TypeLits/Extra/Solver/Operations.hs#L45 with a constructor for multiplication.
And create the mult constructor here: https://github.com/clash-lang/ghc-typelits-extra/blob/14b52940d30172aee1c315dbc9868c0314017e99/src/GHC/TypeLits/Extra/Solver/Unify.hs#L38
And add an extra field for the multiplication tycon here: https://github.com/clash-lang/ghc-typelits-extra/blob/14b52940d30172aee1c315dbc9868c0314017e99/src/GHC/TypeLits/Extra/Solver/Operations.hs#L76
The rest should follow for solving all the type errors.
I'd like to define the following:
However, with
-fplugin GHC.TypeLits.Normalise
(0.3.1),-fplugin GHC.TypeLits.KnownNat.Solver
(0.7),-fplugin GHC.TypeLits.Extra.Solver
(0.7),and-fconstraint-solver-iterations=0
, ghc 8.6.5 won't have this and complains:Is there any way to achieve this?
PS: I can define this:
but this doesn't give me what I need downstream.