Data.Vector.Fusion.Util

vector-0.11.0.0: Efficient Arrays

Copyright | (c) Roman Leshchinskiy 2009
License | BSD-style
Maintainer | Roman Leshchinskiy <rl@cse.unsw.edu.au>
Stability | experimental
Portability | portable
Safe Haskell | Safe
Language | Haskell2010

Data.Vector.Fusion.Util

Description

Fusion-related utility types

Synopsis

- newtype Id a = Id {
  - unId :: a
  }
- data Box a = Box {
  - unBox :: a
  }
- delay_inline :: (a -> b) -> a -> b
- delayed_min :: Int -> Int -> Int

# Documentation

newtype Id a #

Identity monad

Constructors

Id |
Fields unId :: a

Instances

Monad Id # |
Methods (>>=) :: Id a -> (a -> Id b) -> Id b # (>>) :: Id a -> Id b -> Id b # return :: a -> Id a # fail :: String -> Id a #
Functor Id # |
Methods fmap :: (a -> b) -> Id a -> Id b # (<$) :: a -> Id b -> Id a #
Applicative Id # |
Methods pure :: a -> Id a # (<*>) :: Id (a -> b) -> Id a -> Id b # (*>) :: Id a -> Id b -> Id b # (<*) :: Id a -> Id b -> Id a #

data Box a #

Box monad

Constructors

Box |
Fields unBox :: a

Instances

Monad Box # |
Methods (>>=) :: Box a -> (a -> Box b) -> Box b # (>>) :: Box a -> Box b -> Box b # return :: a -> Box a # fail :: String -> Box a #
Functor Box # |
Methods fmap :: (a -> b) -> Box a -> Box b # (<$) :: a -> Box b -> Box a #
Applicative Box # |
Methods pure :: a -> Box a # (<*>) :: Box (a -> b) -> Box a -> Box b # (*>) :: Box a -> Box b -> Box b # (<*) :: Box a -> Box b -> Box a #

delay_inline :: (a -> b) -> a -> b #

Delay inlining a function until late in the game (simplifier phase 0).

delayed_min :: Int -> Int -> Int #

`min` inlined in phase 0