WebFudgets-0.1.0.1: Web Fudgets is a prototype library for writing web application in a functional style in Haskell.

MaintainerThomas Hallgren
StabilityExperimental
Safe HaskellNone
LanguageHaskell2010

WebFudgetsExtras

Contents

Description

 

Synopsis

Types and operators

type E d = F d d

Editor Fudget

type BF b = F b b

Button Fudget

type family fud1 >+< fud2

The type of a tagged parallel composition of two fudgets

Equations

(F i1 o1) >+< (F i2 o2) = F (i1 + i2) (o1 + o2) 

(&) :: (a -> c) -> (b -> c) -> Either a b -> c infixl 1

Infix operator for the either function

Augmented user interface elements

bufferButtonF :: AttrValue -> F (Maybe ho) ho

A buttonF that can be in two different states:

  • after receiving Nothing: disabled.
  • after receiving Just d: enabled, outputting d when clicked.

pickyReadShowF :: (Read a, Show a) => F a (Maybe a)

Like readShowF but turns red and outputs Nothing when there is a syntax error in the input.

filterSelectF :: Eq alt => Options alt -> SelectF alt

Like dynSelectF, but also lets the user filter the list (for easier selections from long lists)

Popup Windows

hiddenDivF :: F t ho -> F t ho

popupShellF :: String -> Maybe (Int, Int) -> F i o -> F i (i, o)

List Editor

listEditorF :: LE d -> ((SelectF Int >+< E d) >+< BF CRUD) -> E [d]

Create a list editor from a combination of

  • a fudget that shows the list and allows the user to select a list item
  • a fudget for editing a selected list item
  • buttons for creating, updating and deleting list items

data LE d

Constructors

LE 

Fields

leStart :: ([d], Int)
 
leEmpty :: d
 
leShow :: d -> String
 

data CRUD

Constructors

Up 
Down 
Create 
Update 
Delete 

Persistence

persistentF :: (Show a, Read a) => String -> a -> E a -> E a

Makes a fudget for editing some kind of input remember the entered input between sessions (by using localStorageF). The first argument is a unique key.

Undo/Redo History

undoRedoF :: E a -> E a

Add Undo/Redo buttons to an editor.

Editors

editorF :: Editable a => E a

class Show a => Editable a where

Minimal complete definition

editorF', initial

Methods

editorF' :: a -> E a

initial :: a

listEditorF' :: [a] -> E [a]

Other utilities

watchF :: (Show a, Show a1) => [Char] -> F a1 a -> F a1 a

enumAll :: (Bounded a, Enum a) => [a]

flat3 :: ((t, t1), t2) -> (t, t1, t2)

nest3 :: (t1, t2, t) -> ((t1, t2), t)