-- |
-- Module      : Foundation.Strict
-- License     : BSD-style
-- Maintainer  : Foundation
-- Stability   : stable
-- Portability : portable
--
-- Enforce strictness when executing lambda
--

module Foundation.Strict
    ( strict1
    , strict2
    , strict3
    , strict4
    , strict5
    , strict6
    ) where

strict1 :: (a -> b) -> a -> b
strict1 :: (a -> b) -> a -> b
strict1 a -> b
f !a
a = a -> b
f a
a

strict2 :: (a -> b -> c) -> a -> b -> c
strict2 :: (a -> b -> c) -> a -> b -> c
strict2 a -> b -> c
f !a
a !b
b = a -> b -> c
f a
a b
b

strict3 :: (a -> b -> c -> d) -> a -> b -> c -> d
strict3 :: (a -> b -> c -> d) -> a -> b -> c -> d
strict3 a -> b -> c -> d
f !a
a !b
b !c
c = a -> b -> c -> d
f a
a b
b c
c

strict4 :: (a -> b -> c -> d -> e) -> a -> b -> c -> d -> e
strict4 :: (a -> b -> c -> d -> e) -> a -> b -> c -> d -> e
strict4 a -> b -> c -> d -> e
f !a
a !b
b !c
c !d
d = a -> b -> c -> d -> e
f a
a b
b c
c d
d

strict5 :: (a -> b -> c -> d -> e -> f) -> a -> b -> c -> d -> e -> f
strict5 :: (a -> b -> c -> d -> e -> f) -> a -> b -> c -> d -> e -> f
strict5 a -> b -> c -> d -> e -> f
f !a
a !b
b !c
c !d
d !e
e = a -> b -> c -> d -> e -> f
f a
a b
b c
c d
d e
e

strict6 :: (a -> b -> c -> d -> e -> f -> g) -> a -> b -> c -> d -> e -> f -> g
strict6 :: (a -> b -> c -> d -> e -> f -> g)
-> a -> b -> c -> d -> e -> f -> g
strict6 a -> b -> c -> d -> e -> f -> g
f !a
a !b
b !c
c !d
d !e
e !f
g = a -> b -> c -> d -> e -> f -> g
f a
a b
b c
c d
d e
e f
g