From 9f9dcf54c3adb45012dd01dfd8137764046c968f Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Fri, 27 Mar 2020 12:07:16 -0700 Subject: Add onomatopoeitic operators It's easier to remember what operators do, and thus easier to write and read condens code, if they follow some symbolic pattern or visually represent the concept to which they map. This is in part inspired by hoon, in part by OCaml's operators. I'm not married to these operators specifically, but I think they are good so far. --- Com/InfluencedByBooks/Core.hs | 4 ++-- Com/InfluencedByBooks/Move.hs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'Com/InfluencedByBooks') diff --git a/Com/InfluencedByBooks/Core.hs b/Com/InfluencedByBooks/Core.hs index 1a8bf6f..6984004 100644 --- a/Com/InfluencedByBooks/Core.hs +++ b/Com/InfluencedByBooks/Core.hs @@ -100,7 +100,7 @@ see m = div_ [ class_ "container mt-5" ] NotAsked -> [ text "Initializing..." ] Loading -> [ text "Loading..." ] Failure err -> [ text err ] - Success ps -> seePerson /@ ps + Success ps -> seePerson View Action @@ -115,7 +115,7 @@ seePerson person = div_ [ class_ "card" ] ] , p_ [ class_ "card-text" ] [ text $ ms $ _blurb person - , ul_ [] $ seeBook /@ _books person + , ul_ [] $ seeBook Model -> Effect Action Model move Nop m = noEff m move (HandleRoute u) m = m { uri = u } <# pure Nop move (ChangeRoute u) m = m <# do pushURI u >> pure Nop -move FetchPeople m = m <# (SetPeople /@ fetchPeople) +move FetchPeople m = m <# (SetPeople pure $ Failure "could not read from server" Just a -> pure -- cgit v1.2.3