-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | A solution to boolean blindness.
--   
--   Please see README.md.
@package choice
@version 0.2.1


-- | Represent do/don't, is/isn't, with/without flags with <a>Choice</a>.
--   
--   <a>Boolean blindness</a> refers to the problem that boolean literals
--   on their own aren't very informative. In any given context, what does
--   <a>True</a> mean? What does <a>False</a> mean? Instead of passing
--   arguments of type <a>Bool</a> to functions, consider using
--   <a>Choice</a>.
--   
--   <a>Choice</a> is the type of labeled booleans. Use it as follows:
--   
--   <pre>
--   {-# LANGUAGE OverloadedLabels #-}
--   
--   import Data.Choice (Choice, Do, Don't)
--   
--   -- Blocking read: block until N bytes available.
--   -- Non-blocking: return as many bytes as are available.
--   readBytes :: Handle -&gt; Choice "block" -&gt; Int -&gt; IO ByteString
--   readBytes = ...
--   
--   action1 = print =&lt;&lt; readBytes h (Don't #block) 1024
--   </pre>
--   
--   For GHC &lt; 8.0, where overloaded labels are not available,
--   substitute <tt>(Label :: Label "block")</tt> for <tt>#block</tt>.
--   
--   <b>A comment on labels:</b> why use labels? We could as well ask the
--   user to define ad hoc constructors. But unlike constructors, labels
--   are guaranteed to be singletons. That's exactly what we want: a label
--   doesn't carry any runtime information, it's just a type annotation.
--   Better yet, with labels, there is no need to ensure that constructor
--   names are unique, nor to pollute the precious constructor namespace in
--   a large module with many flags.
module Data.Choice

-- | A labeled boolean choice.
data Choice (a :: Symbol)
fromBool :: Bool -> Choice a
toBool :: Choice a -> Bool

-- | Alias for <a>True</a>, e.g. <tt>Do #block</tt>.
pattern Do :: Label a -> Choice a

-- | Alias for <a>False</a>, e.g. <tt>Don't #block</tt>.
pattern Don't :: Label a -> Choice a

-- | Alias for <a>True</a>, e.g. <tt>Is #ordered</tt>.
pattern Is :: Label a -> Choice a

-- | Alias for <a>False</a>, e.g. <tt>Isn't #ordered</tt>.
pattern Isn't :: Label a -> Choice a

-- | Alias for <a>True</a>, e.g. <tt>With #ownDirectory</tt>.
pattern With :: Label a -> Choice a

-- | Alias for <a>False</a>, e.g. <tt>Without #ownDirectory</tt>.
pattern Without :: Label a -> Choice a

-- | A synonym for <a>Proxy</a>.
data Label (a :: Symbol)
Label :: Label (a :: Symbol)
instance GHC.Show.Show (Data.Choice.Label a)
instance GHC.Classes.Ord (Data.Choice.Label a)
instance GHC.Classes.Eq (Data.Choice.Label a)
instance GHC.Generics.Generic (Data.Choice.Choice a)
instance GHC.Classes.Ord (Data.Choice.Choice a)
instance GHC.Classes.Eq (Data.Choice.Choice a)
instance GHC.Show.Show (Data.Choice.Choice a)
instance GHC.Enum.Enum (Data.Choice.Choice a)
instance GHC.Enum.Bounded (Data.Choice.Choice a)
instance (x GHC.Types.~ x') => GHC.OverloadedLabels.IsLabel x (Data.Choice.Label x')
