From 751b725332fd0e9397b7cfd3f3a3bff14056c232 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Tue, 7 Apr 2020 22:07:07 -0700 Subject: Return the app state as a simple dashboard --- Com/Simatime/Alpha.hs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'Com/Simatime/Alpha.hs') diff --git a/Com/Simatime/Alpha.hs b/Com/Simatime/Alpha.hs index 8f5a506..cc3d23c 100644 --- a/Com/Simatime/Alpha.hs +++ b/Com/Simatime/Alpha.hs @@ -11,6 +11,9 @@ module Com.Simatime.Alpha , (/>) , () ) import Data.String import Data.Text ( Text ) +import qualified Data.Text as Text +import qualified Data.Text.Lazy as LazyText import qualified Prelude import Protolude as X @@ -63,3 +68,11 @@ infixr 0 <| -- functor. Could also be defined as `f >>= return . g` (/>) :: Functor f => f a -> (a -> b) -> f b (/>) = (<&>) + +-- | Removes newlines from text. +chomp :: Text -> Text +chomp = Text.filter (/= '\n') + +-- | Removes newlines from lazy text. +lchomp :: LazyText.Text -> LazyText.Text +lchomp = LazyText.filter (/= '\n') -- cgit v1.2.3