Safe Haskell | None |
---|---|
Language | Haskell2010 |
Another way to desugar list literals.
An explicit list expression, e.g. [1, True]
is desugared to
cons 1 (cons True nil)
This desugaring uses bidirectional functional dependencies to
make cons
infer more. The trade-off is that we can have strictly
less instances.
Enabled with:
{-# OPTIONS_GHC -fplugin=Overloaded -fplugin-opt=Overloaded:Lists=Overloaded.Lists.Bidi.nil=Overloaded.Lists.Bidi.cons
Documentation
class Cons x ys zs => Cons x ys zs | zs -> x ys, x ys -> zs where Source #
Bidirectional class for Cons :
.
Since: 0.2
Nothing
Instances
Cons Int IntSet IntSet Source # | |
(a ~ b, b ~ c) => Cons a (Seq b) (Seq c) Source # | |
(Ord a, a ~ b, b ~ c) => Cons a (Set a) (Set a) Source # | |
(a ~ b, b ~ c) => Cons a [b] [c] Source # | |
Defined in Overloaded.Lists.Bidi | |
(a ~ b, b ~ c, m ~ 'S n) => Cons a (Vec n b) (Vec m c) Source # | |
(f ~ g, g ~ h, xxs ~ (x ': xs)) => Cons (f x) (NP g xs) (NP h xxs) Source # | |
(i ~ Int, a ~ b, b ~ c) => Cons (i, a) (IntMap b) (IntMap c) Source # | |
(Ord k, k ~ k1, k ~ k2, v ~ v1, v ~ v2) => Cons (k, v) (Map k1 v1) (Map k2 v2) Source # | |
(f ~ g, g ~ h, xsxss ~ (xs ': xss)) => Cons (NP f xs) (POP g xss) (POP h xsxss) Source # | |