jaror,
@jaror@kbin.social avatar

Of course StateT is perhaps more common and as elegant as Kleisli:

recognise :: RE -> StateT String [] ()
recognise =
  foldRE empty (pure ()) ch (*>) (<|>) (p -> fix (t -> p *> t <|> pure ())) where
    ch c = StateT (case x : xs | c == x -> [((), xs)]; _ -> [])

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • uselessserver093
  • Food
  • aaaaaaacccccccce
  • [email protected]
  • test
  • CafeMeta
  • testmag
  • MUD
  • RhythmGameZone
  • RSS
  • dabs
  • Socialism
  • KbinCafe
  • TheResearchGuardian
  • Ask_kbincafe
  • oklahoma
  • feritale
  • SuperSentai
  • KamenRider
  • All magazines