summaryrefslogtreecommitdiff
path: root/testsuite/tests/printer/Ppr028.hs
blob: 8c9e7ddf0945ebba53e5e5ef1460176c5239580f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
{-#LANGUAGE Arrows, RankNTypes, ScopedTypeVariables, FlexibleContexts,
  TypeSynonymInstances, NoMonomorphismRestriction, FlexibleInstances #-}

valForm initVal vtor label = withInput $
    proc ((),nm,fi) -> do
      s_curr <- keepState initVal -< fi
      valid <- vtor -< s_curr
      case valid of
         Left err -> returnA -< (textField label (Just err) s_curr nm,
                                                   Nothing)
         Right x -> returnA -< (textField label Nothing s_curr nm,
                                Just x)