git.iko.soy/rowtype-yoga/purescript-native
on cd4c708 help sign in
rowtype-yoga/purescript-native/examples/passing/ExtendedInfixOperators.purs
17 lines 332 B history raw
1module Main where
3import Prelude
4import Control.Monad.Eff.Console (log, logShow)
5import Data.Function (on)
7comparing :: forall a b. (Ord b) => (a -> b) -> a -> a -> Ordering
8comparing f = compare `on` f
10null [] = true
11null _ = false
13test = [1.0, 2.0, 3.0] `comparing null` [4.0, 5.0, 6.0]
15main = do
16 logShow test
17 log "Done"