DeepDarkFantasy-0.2017.8.10: A DSL for creating neural network.

Safe HaskellNone
LanguageHaskell2010

DDF.TermGen

Documentation

type family SubLC (l :: (* -> * -> *) -> Constraint) (r :: (* -> * -> *) -> Constraint) :: Constraint Source #

Instances

type SubLC c Option Source # 
type SubLC c Option = SubL c DBI
type SubLC c VectorTF Source # 
type SubLC c Map Source # 
type SubLC c Map = (SubL c Prod, SubL c Option)
type SubLC c Y Source # 
type SubLC c Y = SubL c DBI
type SubLC c Prod Source # 
type SubLC c Prod = SubL c DBI
type SubLC c List Source # 
type SubLC c List = SubL c Y
type SubLC c IO Source # 
type SubLC c IO = (SubL c Unit, SubL c Char, SubL c List)
type SubLC c Sum Source # 
type SubLC c Sum = SubL c DBI
type SubLC c Unit Source # 
type SubLC c Unit = SubL c DBI
type SubLC c Dual Source # 
type SubLC c Dual = SubL c Prod
type SubLC c Double Source # 
type SubLC c Double = SubL c Bool
type SubLC c Float Source # 
type SubLC c Float = SubL c DBI
type SubLC c Bimap Source # 
type SubLC c Bimap = (SubL c Int, SubL c Map)
type SubLC c Char Source # 
type SubLC c Char = SubL c DBI
type SubLC c DiffWrapper Source # 
type SubLC c FreeVector Source # 
type SubLC c Lang Source # 
type SubLC c Fix Source # 
type SubLC c Fix = SubL c DBI
type SubLC c Int Source # 
type SubLC c Int = SubL c Bool
type SubLC c Bool Source # 
type SubLC c Bool = SubL c DBI
type SubLC c DBI Source # 
type SubLC c DBI = ()

class SubLC l r => SubL l r where Source #

Minimal complete definition

sub

Methods

sub :: forall repr. l repr :- r repr Source #

newtype Term c h s Source #

Constructors

Term 

Fields

  • runTerm :: forall r. c r => r h s
     

Instances

SubL c DBI => DBI (Term c) Source # 

Methods

z :: Term c (a, h) a Source #

s :: Term c h b -> Term c (a, h) b Source #

abs :: Term c (a, h) b -> Term c h (a -> b) Source #

app :: Term c h (a -> b) -> Term c h a -> Term c h b Source #

hoas :: (Term c (a, h) a -> Term c (a, h) b) -> Term c h (a -> b) Source #

com :: Term c h ((b -> c) -> (a -> b) -> a -> c) Source #

flip :: Term c h ((a -> b -> c) -> b -> a -> c) Source #

id :: Term c h (a -> a) Source #

const :: Term c h (a -> b -> a) Source #

scomb :: Term c h ((a -> b -> c) -> (a -> b) -> a -> c) Source #

dup :: Term c h ((a -> a -> b) -> a -> b) Source #

let_ :: Term c h (a -> (a -> b) -> b) Source #

SubL c Fix => Fix (Term c) Source # 

Methods

fix :: Term c h (f (Fix f) -> Fix f) Source #

runFix :: Term c h (Fix f -> f (Fix f)) Source #

SubL c Float => Float (Term c) Source # 
SubL c FreeVector => FreeVector (Term c) Source # 

Methods

freeVector :: Term c h ((b -> d) -> FreeVector b d) Source #

runFreeVector :: Term c h (FreeVector b d -> b -> d) Source #

SubL c Option => Option (Term c) Source # 

Methods

nothing :: Term c h (Maybe a) Source #

just :: Term c h (a -> Maybe a) Source #

optionMatch :: Term c h (b -> (a -> b) -> Maybe a -> b) Source #

SubL c Prod => Prod (Term c) Source # 

Methods

mkProd :: Term c h (a -> b -> (a, b)) Source #

zro :: Term c h ((a, b) -> a) Source #

fst :: Term c h ((a, b) -> b) Source #

swap :: Term c h ((x, y) -> (y, x)) Source #

curry :: Term c h (((a, b) -> c) -> a -> b -> c) Source #

uncurry :: Term c h ((a -> b -> c) -> (a, b) -> c) Source #

SubL c Dual => Dual (Term c) Source # 

Methods

dual :: Term c h ((x, y) -> Dual x y) Source #

runDual :: Term c h (Dual x y -> (x, y)) Source #

mkDual :: Term c h (x -> y -> Dual x y) Source #

dualOrig :: Term c h (Dual x y -> x) Source #

dualDiff :: Term c h (Dual x y -> y) Source #

SubL c Sum => Sum (Term c) Source # 

Methods

left :: Term c h (a -> Either a b) Source #

right :: Term c h (b -> Either a b) Source #

sumMatch :: Term c h ((a -> c) -> (b -> c) -> Either a b -> c) Source #

SubL c Unit => Unit (Term c) Source # 

Methods

unit :: Term c h () Source #

SubL c Y => Y (Term c) Source # 

Methods

y :: Term c h ((a -> a) -> a) Source #

undefined :: Term c h a Source #

SubL c List => List (Term c) Source # 

Methods

nil :: Term c h [a] Source #

cons :: Term c h (a -> [a] -> [a]) Source #

listMatch :: Term c h (b -> (a -> [a] -> b) -> [a] -> b) Source #

listAppend :: Term c h ([a] -> [a] -> [a]) Source #

SubL c Char => Char (Term c) Source # 

Methods

char :: Char -> Term c h Char Source #

SubL c IO => IO (Term c) Source # 

Methods

putStrLn :: Term c h (String -> IO ()) Source #

SubL c Bool => Bool (Term c) Source # 

Methods

bool :: Bool -> Term c h Bool Source #

ite :: Term c h (a -> a -> Bool -> a) Source #

SubL c Double => Double (Term c) Source # 
SubL c Map => Map (Term c) Source # 

Methods

empty :: Term c h (Map k a) Source #

singleton :: Term c h (k -> a -> Map k a) Source #

lookup :: Ord k => Term c h (Map k a -> k -> Maybe a) Source #

alter :: Ord k => Term c h ((Maybe a -> Maybe a) -> k -> Map k a -> Map k a) Source #

mapMap :: Term c h ((a -> b) -> Map k a -> Map k b) Source #

unionWith :: Ord k => Term c h ((a -> a -> a) -> Map k a -> Map k a -> Map k a) Source #

insert :: Ord k => Term c h (k -> a -> Map k a -> Map k a) Source #

SubL c DiffWrapper => DiffWrapper (Term c) Source # 
SubL c VectorTF => VectorTF (Term c) Source # 

Methods

zero :: Term c h (VectorTF t f) Source #

basis :: Term c h (t -> VectorTF t f) Source #

plus :: Term c h (f -> f -> VectorTF t f) Source #

mult :: Term c h (Double -> f -> VectorTF t f) Source #

vtfMatch :: Term c h (a -> (t -> a) -> (f -> f -> a) -> (Double -> f -> a) -> VectorTF t f -> a) Source #

SubL c Int => Int (Term c) Source # 

Methods

int :: Int -> Term c h Int Source #

pred :: Term c h (Int -> Int) Source #

isZero :: Term c h (Int -> Bool) Source #

SubL c Bimap => Bimap (Term c) Source # 

Methods

size :: Term c h (Bimap a b -> Int) Source #

lookupL :: (Ord a, Ord b) => Term c h (Bimap a b -> a -> Maybe b) Source #

lookupR :: (Ord a, Ord b) => Term c h (Bimap a b -> b -> Maybe a) Source #

empty :: Term c h (Bimap a b) Source #

singleton :: Term c h ((a, b) -> Bimap a b) Source #

toMapL :: Term c h (Bimap a b -> Map a b) Source #

toMapR :: Term c h (Bimap a b -> Map b a) Source #

insert :: (Ord a, Ord b) => Term c h ((a, b) -> Bimap a b -> Bimap a b) Source #

updateL :: (Ord a, Ord b) => Term c h ((b -> Maybe b) -> a -> Bimap a b -> Bimap a b) Source #

updateR :: (Ord a, Ord b) => Term c h ((a -> Maybe a) -> b -> Bimap a b -> Bimap a b) Source #

SubL c Lang => Lang (Term c) Source # 

Methods

exfalso :: Term c h (Void -> a) Source #

writer :: Term c h ((a, w) -> Writer w a) Source #

runWriter :: Term c h (Writer w a -> (a, w)) Source #

float2Double :: Term c h (Float -> Double) Source #

double2Float :: Term c h (Double -> Float) Source #

state :: Term c h ((x -> (y, x)) -> State x y) Source #

runState :: Term c h (State x y -> x -> (y, x)) Source #

iterate :: Term c h ((x -> x) -> x -> [x]) Source #

buildFreeVector :: Ord b => Term c h (FreeVectorBuilder b -> FreeVector b Double) Source #

toSVTFBuilder :: Ord b => Term c h (VectorTF b Int -> SVTFBuilder b) Source #

get :: Term c h (Maybe a -> a) Source #

getVar :: Term c h (State x x) Source #

update :: Term c h ((x -> x) -> State x ()) Source #

updateWengert :: Term c h (Int -> Double -> Map Int Double -> Map Int Double) Source #

vtfCata :: Term c h ((VectorTF a b -> b) -> Fix (VectorTF a) -> b) Source #

SubL c IO => Monad (Term c) IO Source # 

Methods

bind :: Term c h (IO a -> (a -> IO b) -> IO b) Source #

join :: Term c h (IO (IO a) -> IO a) Source #

SubL c IO => Applicative (Term c) IO Source # 

Methods

pure :: Term c h (x -> IO x) Source #

ap :: Term c h (IO (x -> y) -> IO x -> IO y) Source #

SubL c IO => Functor (Term c) IO Source # 

Methods

map :: Term c h ((a -> b) -> IO a -> IO b) Source #

mkT :: forall r l h s. SubL l r => (forall repr. (l repr, r repr) => repr h s) -> Term l h s Source #

module DDF.Lang