overloaded-0.1.3: Overloaded pragmas as a plugin

Safe HaskellNone
LanguageHaskell2010

Overloaded.Lists

Description

Another way to desugar overloaded numeric literals. See FromNatural.

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.2

Instance details

Defined in Overloaded.Lists

Methods

nil :: IntSet Source #

Nil [a] Source # 
Instance details

Defined in Overloaded.Lists

Methods

nil :: [a] Source #

Nil (Set a) Source #

Since: 0.1.2

Instance details

Defined in Overloaded.Lists

Methods

nil :: Set 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 Source #

Instances
Cons Int IntSet IntSet Source #

Since: 0.1.2

Instance details

Defined in Overloaded.Lists

Methods

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

Ord a => Cons a (Set a) (Set a) Source #

Since: 0.1.2

Instance details

Defined in Overloaded.Lists

Methods

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

Cons a [a] (NonEmpty a) Source # 
Instance details

Defined in Overloaded.Lists

Methods

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

Cons a [a] [a] Source # 
Instance details

Defined in Overloaded.Lists

Methods

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

Cons a (Vec n a) (Vec (S n) a) Source # 
Instance details

Defined in Overloaded.Lists

Methods

cons :: a -> Vec n a -> Vec (S n) a Source #

Cons (f x) (NP f xs) (NP f (x ': xs)) Source # 
Instance details

Defined in Overloaded.Lists

Methods

cons :: f x -> NP f xs -> NP f (x ': xs) Source #

Cons (NP f xs) (POP f xss) (POP f (xs ': xss)) Source # 
Instance details

Defined in Overloaded.Lists

Methods

cons :: NP f xs -> POP f xss -> POP f (xs ': xss) Source #

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

Since: 0.1.2