haskell-halogen-core
Safe HaskellNone
LanguageGHC2021

Halogen

Synopsis

Documentation

data HalogenSocket (query :: Type -> Type) output (m :: Type -> Type) Source #

Constructors

HalogenSocket 

Fields

data Slot (query :: Type -> Type) output slotType Source #

data VoidF (p :: k) Source #

componentSlot :: forall (label :: Symbol) -> forall (query :: Type -> Type) input output (slots :: Row Type) (m :: Type -> Type) action slot. (HasType label (Slot query output slot) slots, KnownSymbol label, Ord slot) => slot -> Component query input output m -> input -> (output -> Maybe action) -> ComponentSlotBox slots m action Source #

Constructs a ComponentSlot | | Takes: | - the slot address label | - the slot address index | - the component for the slot | - the input value to pass to the component | - a function mapping outputs from the component to a query in the parent

defaultEval :: forall state (query :: Type -> Type) action (slots :: Row Type) input output (m :: Type -> Type). EvalSpec state query action slots input output m Source #

A default value for mkEval that will result in an eval that nothing at | all - all incoming actions and queries will be ignored, and no receiver, | initializer, or finalizer will be specified. | | Usually this will be used with record update syntax to override fields to | specify things as needed. If a component only needs to handle actions, | for instance, a usage might be something like this: | | ```purescript | H.mkComponent | { initialState | , render | , eval: H.mkEval (H.defaultEval { handleAction = ?handleAction }) | } | ```

hoist :: forall (query :: Type -> Type) input output (m :: Type -> Type) (m' :: Type -> Type). Functor m' => (m ~> m') -> Component query input output m -> Component query input output m' Source #

Changes the Component's m type. A use case for this | might be to interpret some Free monad as IO so the component can be | used with runUI.

mkComponent :: forall state (query :: Type -> Type) action (slots :: Row Type) input output (m :: Type -> Type). ComponentSpec state query action slots input output m -> Component query input output m Source #

mkEval :: forall state (query :: Type -> Type) action (slots :: Row Type) input output (m :: Type -> Type). EvalSpec state query action slots input output m -> HalogenQ query action input ~> HalogenM state action slots output m Source #

Accepts an EvalSpec to produce an eval function for a component. For | example: | | ```purescript | -- use defaultEval and override fields selectively | H.mkEval (H.defaultEval { handleAction = ?handleAction }) | | -- or specify all the fields in the EvalSpec | H.mkEval | { handleAction: ?handleAction | , handleQuery: ?handleQuery | , receive: ?receive | , initialize: ?initialize | , finalize: ?finalize | } | ```

data Component (query :: Type -> Type) input output (m :: Type -> Type) Source #

Constructors

Component (ComponentSpec model query msg slots input output m) 

data ComponentSlot (slots :: Row Type) (m :: Type -> Type) msg Source #

Instances

Instances details
Functor (ComponentSlot slots' m) Source # 
Instance details

Defined in Halogen.Component

Methods

fmap :: (a -> b) -> ComponentSlot slots' m a -> ComponentSlot slots' m b #

(<$) :: a -> ComponentSlot slots' m b -> ComponentSlot slots' m a #

data ComponentSlotBox (slots :: Row Type) (m :: Type -> Type) msg Source #

Instances

Instances details
Functor (ComponentSlotBox slots' m) Source # 
Instance details

Defined in Halogen.Component

Methods

fmap :: (a -> b) -> ComponentSlotBox slots' m a -> ComponentSlotBox slots' m b #

(<$) :: a -> ComponentSlotBox slots' m b -> ComponentSlotBox slots' m a #

data ComponentSpec' state (query :: Type -> Type) action (slots :: Row Type) input output (m :: Type -> Type) (n :: Type -> Type) Source #

Constructors

ComponentSpec 

Fields

data EvalSpec state (query :: Type -> Type) action (slots :: Row Type) input output (m :: Type -> Type) Source #

The spec record that mkEval accepts to construct a component eval | function. | | It's not a requirement to use mkEval, and sometimes it's preferrable | to write a component eval function from scratch, but often mkEval is | more convenient for common cases. | | See below for more details about mkEval and defaultEval.

Constructors

EvalSpec 

Fields

type ComponentHTML action (slots :: Row Type) (m :: Type -> Type) = HTML (ComponentSlot slots m action) action Source #

A convenience synonym for the output type of a render function for a | component that renders HTML. | | - action is the type of actions, events internal to the component that can | be evaluated with the handleAction function | - slots is the set of child component types that can be used in the HTML | - m is the monad used by the child component during evaluation

newtype ElemName Source #

Constructors

ElemName Text 

Instances

Instances details
IsString ElemName Source # 
Instance details

Defined in Halogen.VDom.Types

Show ElemName Source # 
Instance details

Defined in Halogen.VDom.Types

Eq ElemName Source # 
Instance details

Defined in Halogen.VDom.Types

Ord ElemName Source # 
Instance details

Defined in Halogen.VDom.Types

newtype Namespace Source #

Constructors

Namespace Text 

Instances

Instances details
IsString Namespace Source # 
Instance details

Defined in Halogen.VDom.Types

Show Namespace Source # 
Instance details

Defined in Halogen.VDom.Types

Eq Namespace Source # 
Instance details

Defined in Halogen.VDom.Types

Ord Namespace Source # 
Instance details

Defined in Halogen.VDom.Types

newtype AttrName Source #

Constructors

AttrName Text 

Instances

Instances details
IsString AttrName Source # 
Instance details

Defined in Web.HTML.Common

Show AttrName Source # 
Instance details

Defined in Web.HTML.Common

Eq AttrName Source # 
Instance details

Defined in Web.HTML.Common

Ord AttrName Source # 
Instance details

Defined in Web.HTML.Common

newtype ClassName Source #

Constructors

ClassName Text 

Instances

Instances details
IsString ClassName Source # 
Instance details

Defined in Web.HTML.Common

Show ClassName Source # 
Instance details

Defined in Web.HTML.Common

Eq ClassName Source # 
Instance details

Defined in Web.HTML.Common

Ord ClassName Source # 
Instance details

Defined in Web.HTML.Common

newtype PropName (value :: k) Source #

Constructors

PropName Text 

Instances

Instances details
IsString (PropName value) Source # 
Instance details

Defined in Web.HTML.Common

Methods

fromString :: String -> PropName value #

Show (PropName value) Source # 
Instance details

Defined in Web.HTML.Common

Methods

showsPrec :: Int -> PropName value -> ShowS #

show :: PropName value -> String #

showList :: [PropName value] -> ShowS #

Eq (PropName value) Source # 
Instance details

Defined in Web.HTML.Common

Methods

(==) :: PropName value -> PropName value -> Bool #

(/=) :: PropName value -> PropName value -> Bool #

Ord (PropName value) Source # 
Instance details

Defined in Web.HTML.Common

Methods

compare :: PropName value -> PropName value -> Ordering #

(<) :: PropName value -> PropName value -> Bool #

(<=) :: PropName value -> PropName value -> Bool #

(>) :: PropName value -> PropName value -> Bool #

(>=) :: PropName value -> PropName value -> Bool #

max :: PropName value -> PropName value -> PropName value #

min :: PropName value -> PropName value -> PropName value #