overloaded-0.2.1: Overloaded pragmas as a plugin

Safe HaskellNone
LanguageHaskell2010

Overloaded.Lists.Bidi

Description

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
Synopsis

Documentation

nil :: Nil a => a Source #

class Cons x ys zs => Cons x ys zs | zs -> x ys, x ys -> zs where Source #

Bidirectional class for Cons :.

Since: 0.2

Minimal complete definition

Nothing

Methods

cons :: x -> ys -> zs infixr 5 Source #

Instances
Cons Int IntSet IntSet Source # 
Instance details

Defined in Overloaded.Lists.Bidi

Methods

cons :: Int -> IntSet -> IntSet Source #

(a ~ b, b ~ c) => Cons a (Seq b) (Seq c) Source # 
Instance details

Defined in Overloaded.Lists.Bidi

Methods

cons :: a -> Seq b -> Seq c Source #

(Ord a, a ~ b, b ~ c) => Cons a (Set a) (Set a) Source # 
Instance details

Defined in Overloaded.Lists.Bidi

Methods

cons :: a -> Set a -> Set a Source #

(a ~ b, b ~ c) => Cons a [b] [c] Source # 
Instance details

Defined in Overloaded.Lists.Bidi

Methods

cons :: a -> [b] -> [c] Source #

(a ~ b, b ~ c, m ~ S n) => Cons a (Vec n b) (Vec m c) Source # 
Instance details

Defined in Overloaded.Lists.Bidi

Methods

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 # 
Instance details

Defined in Overloaded.Lists.Bidi

Methods

cons :: f x -> NP g xs -> NP h xxs Source #

(i ~ Int, a ~ b, b ~ c) => Cons (i, a) (IntMap b) (IntMap c) Source # 
Instance details

Defined in Overloaded.Lists.Bidi

Methods

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 # 
Instance details

Defined in Overloaded.Lists.Bidi

Methods

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 # 
Instance details

Defined in Overloaded.Lists.Bidi

Methods

cons :: NP f xs -> POP g xss -> POP h xsxss Source #

fromList :: (Nil xs, Cons x xs xs) => [x] -> xs Source #

Since: 0.1.3