overloaded-0.1.2: Overloaded pragmas as a plugin

Safe HaskellSafe
LanguageHaskell2010

Overloaded.If

Description

Overloaded if-expression.

Synopsis

Documentation

class ToBool b where Source #

Class for Bool-like datastrucutres

An if--expression if b then t else e is desugared to

ifte (toBool b) t e

Enabled with:

{-# OPTIONS -fplugin=Overloaded -fplugin-opt=Overloaded:If #-}

Methods

toBool :: b -> Bool Source #

Instances
ToBool Bool Source # 
Instance details

Defined in Overloaded.If

Methods

toBool :: Bool -> Bool Source #

ToBool (Maybe a) Source #

Just is True

Instance details

Defined in Overloaded.If

Methods

toBool :: Maybe a -> Bool Source #

ToBool (Either b a) Source #

Right is True

Instance details

Defined in Overloaded.If

Methods

toBool :: Either b a -> Bool Source #

ifte :: ToBool b => b -> a -> a -> a Source #

ToBool overloaded if-expression.