monad-memo-0.5.4: Memoization monad transformer

Copyright | (c) Eduard Sergeev 2013
License | BSD-style (see the file LICENSE)
Maintainer | eduard.sergeev@gmail.com
Stability | experimental
Portability | non-portable (multi-param classes, functional dependencies)
Safe Haskell | Safe-Inferred
Language | Haskell2010

Data.MaybeLike

Description

Defines MaybeLike typeclass - a generic way to look at some types as if they were Maybe

It is currently used to add maybe-ness to `unboxed` primitive types in cases when it isn't possuble to just use `Maybe a` (e.g. unboxed arrays)

Synopsis

- class MaybeLike a v | a -> v where
  - nothing :: a
  - isNothing :: a -> Bool
  - just :: v -> a
  - fromJust :: a -> v

# Documentation

class MaybeLike a v | a -> v where Source #

An abstract interface to a type which may not have a value

Methods

nothing :: a Source #

isNothing :: a -> Bool Source #

just :: v -> a Source #

fromJust :: a -> v Source #

#### Instances

Instances details

MaybeLike Int16 Int16 Source # |
Instance details Defined in Data.MaybeLike.Instances Methods nothing :: Int16 Source # isNothing :: Int16 -> Bool Source # just :: Int16 -> Int16 Source # fromJust :: Int16 -> Int16 Source #
MaybeLike Int32 Int32 Source # |
Instance details Defined in Data.MaybeLike.Instances Methods nothing :: Int32 Source # isNothing :: Int32 -> Bool Source # just :: Int32 -> Int32 Source # fromJust :: Int32 -> Int32 Source #
MaybeLike Int64 Int64 Source # |
Instance details Defined in Data.MaybeLike.Instances Methods nothing :: Int64 Source # isNothing :: Int64 -> Bool Source # just :: Int64 -> Int64 Source # fromJust :: Int64 -> Int64 Source #
MaybeLike Int8 Int8 Source # |
Instance details Defined in Data.MaybeLike.Instances Methods nothing :: Int8 Source # isNothing :: Int8 -> Bool Source # just :: Int8 -> Int8 Source # fromJust :: Int8 -> Int8 Source #
MaybeLike Word16 Word16 Source # |
Instance details Defined in Data.MaybeLike.Instances Methods nothing :: Word16 Source # isNothing :: Word16 -> Bool Source # just :: Word16 -> Word16 Source # fromJust :: Word16 -> Word16 Source #
MaybeLike Word32 Word32 Source # |
Instance details Defined in Data.MaybeLike.Instances Methods nothing :: Word32 Source # isNothing :: Word32 -> Bool Source # just :: Word32 -> Word32 Source # fromJust :: Word32 -> Word32 Source #
MaybeLike Word64 Word64 Source # |
Instance details Defined in Data.MaybeLike.Instances Methods nothing :: Word64 Source # isNothing :: Word64 -> Bool Source # just :: Word64 -> Word64 Source # fromJust :: Word64 -> Word64 Source #
MaybeLike Word8 Word8 Source # |
Instance details Defined in Data.MaybeLike.Instances Methods nothing :: Word8 Source # isNothing :: Word8 -> Bool Source # just :: Word8 -> Word8 Source # fromJust :: Word8 -> Word8 Source #
MaybeLike Char Char Source # |
Instance details Defined in Data.MaybeLike.Instances Methods nothing :: Char Source # isNothing :: Char -> Bool Source # just :: Char -> Char Source # fromJust :: Char -> Char Source #
MaybeLike Double Double Source # |
Instance details Defined in Data.MaybeLike.Instances Methods nothing :: Double Source # isNothing :: Double -> Bool Source # just :: Double -> Double Source # fromJust :: Double -> Double Source #
MaybeLike Float Float Source # |
Instance details Defined in Data.MaybeLike.Instances Methods nothing :: Float Source # isNothing :: Float -> Bool Source # just :: Float -> Float Source # fromJust :: Float -> Float Source #
MaybeLike Int Int Source # |
Instance details Defined in Data.MaybeLike.Instances Methods nothing :: Int Source # isNothing :: Int -> Bool Source # just :: Int -> Int Source # fromJust :: Int -> Int Source #
MaybeLike Word Word Source # |
Instance details Defined in Data.MaybeLike.Instances Methods nothing :: Word Source # isNothing :: Word -> Bool Source # just :: Word -> Word Source # fromJust :: Word -> Word Source #
MaybeLike (Maybe a) a Source # |
Instance details Defined in Data.MaybeLike.Instances Methods nothing :: Maybe a Source # isNothing :: Maybe a -> Bool Source # just :: a -> Maybe a Source # fromJust :: Maybe a -> a Source #