Skip to content

Instantly share code, notes, and snippets.

@raichoo
Created September 7, 2017 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raichoo/d33d44bd8407211859e9bac14cd26e36 to your computer and use it in GitHub Desktop.
Save raichoo/d33d44bd8407211859e9bac14cd26e36 to your computer and use it in GitHub Desktop.
Data.Text rewrite rules fun.
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Prelude hiding (length, filter)
import Data.Text
-- Turn on optimizations (-O) to make this `False`
wat :: Text -> Bool
wat x = length (filter (== ',') x) == 1
main :: IO ()
main = print (wat "0,00")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment