overloaded-0.2: Overloaded pragmas as a plugin

Safe HaskellNone
LanguageHaskell2010

Overloaded.Lists

Description

Another way to desugar overloaded list literals. See Nil and Cons.

An explicit list expression, e.g. [1, True] is desugared to

cons 1 (cons True nil)

Enabled with:

{-# OPTIONS -fplugin=Overloaded -fplugin-opt=Overloaded:Lists #-}
Synopsis

Documentation

class Nil a where Source #

Class for nil, []

See test-suite for ways to define instances for Map. There are at-least two-ways.

Methods

nil :: a Source #

Instances
Nil IntSet Source #

Since: 0.1.3

Instance details

Defined in Overloaded.Lists

Methods

nil :: IntSet Source #

Nil [a] Source # 
Instance details

Defined in Overloaded.Lists

Methods

nil :: [a] Source #

Nil (IntMap v) Source #

Since: 0.2

Instance details

Defined in Overloaded.Lists

Methods

nil :: IntMap v Source #

Nil (Seq a) Source #

Since: 0.2

Instance details

Defined in Overloaded.Lists

Methods

nil :: Seq a Source #

Nil (Set a) Source #

Since: 0.1.3

Instance details

Defined in Overloaded.Lists

Methods

nil :: Set a Source #

Nil (RAList a) Source # 
Instance details

Defined in Overloaded.Lists

Methods

nil :: RAList a Source #

Nil (Map k v) Source #

Since: 0.2

Instance details

Defined in Overloaded.Lists

Methods

nil :: Map k v Source #

b ~ BZ => Nil (RAVec b a) Source # 
Instance details

Defined in Overloaded.Lists

Methods

nil :: RAVec b a Source #

n ~ Z => Nil (Vec n a) Source # 
Instance details

Defined in Overloaded.Lists

Methods

nil :: Vec n a Source #

xs ~ ([] :: [k]) => Nil (NP f xs) Source # 
Instance details

Defined in Overloaded.Lists

Methods

nil :: NP f xs Source #

xs ~ ([] :: [[k]]) => Nil (POP f xs) Source # 
Instance details

Defined in Overloaded.Lists

Methods

nil :: POP f xs Source #

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

Class for Cons :.

Methods

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

Instances
Cons Int IntSet IntSet Source #

Since: 0.1.3

Instance details

Defined in Overloaded.Lists

Methods

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

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

Defined in Overloaded.Lists

Methods

cons :: a -> RAList b -> NERAList c Source #

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

Defined in Overloaded.Lists

Methods

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

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

Since: 0.2

Instance details

Defined in Overloaded.Lists

Methods

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

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

Since: 0.1.3

Instance details

Defined in Overloaded.Lists

Methods

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

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

Defined in Overloaded.Lists

Methods

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

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

Defined in Overloaded.Lists

Methods

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

(bp ~ Pred b, b ~ Succ' bp) => Cons a (RAVec bp a) (NERAVec b a) Source # 
Instance details

Defined in Overloaded.Lists

Methods

cons :: a -> RAVec bp a -> NERAVec b a Source #

(b ~ BP bb, bp ~ Pred bb, bb ~ Succ' bp) => Cons a (RAVec bp a) (RAVec b a) Source # 
Instance details

Defined in Overloaded.Lists

Methods

cons :: a -> RAVec bp a -> RAVec b a Source #

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

Defined in Overloaded.Lists

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

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 #

Since: 0.2

Instance details

Defined in Overloaded.Lists

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 #

Since: 0.2

Instance details

Defined in Overloaded.Lists

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

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