stgi-1.1: Educational implementation of the STG (Spineless Tagless G-machine)

Safe HaskellNone
LanguageHaskell2010

Stg.Prelude.Function

Description

Definitions found in Haskell's Data.Function.

This module should be imported qualified to avoid clashes with standard Haskell definitions.

Synopsis

Documentation

seq :: Program Source #

Finally I can define seq directly! :-)

Note that this function is less powerful than GHC's seq, since STG does not have a rule to force functions, only expressions that reduce to an algebraic or primitive value. This leads to the fact that STG's seq is less powerful than Haskell's, since in Haskell

seq (const ()) () = ()

whereas in the STG

constUnit = (x) -> Unit ();
seq (constUnit, Unit) = ERROR

id :: Program Source #

Identity function.

id : a -> a

const :: Program Source #

Constant function.

Const : a -> b -> a

compose :: Program Source #

Function composition.

compose : (b -> c) -> (a -> b) -> a -> c

fix :: Program Source #

The fixed point combinator.

fix : (a -> a) -> a