{-# LANGUAGE DataKinds, PolyKinds, RankNTypes, GADTs, TypeFamilies, EmptyCase,
FlexibleContexts, TemplateHaskell, ScopedTypeVariables,
UndecidableInstances, TypeOperators, FlexibleInstances #-}
{-# OPTIONS_GHC -Wno-orphans #-}
module Data.Singletons.Prelude.Instances where
import Data.Singletons.Single
import Data.Singletons.Util
$(genSingletons basicTypes)
$(singDecideInstances basicTypes)
$(singletonsOnly [d|
foldl :: forall a b. (b -> a -> b) -> b -> [a] -> b
foldl f z0 xs0 = lgo z0 xs0
where
lgo :: b -> [a] -> b
lgo z [] = z
lgo z (x:xs) = lgo (f z x) xs
|])