packages feed

egison-5.0.0: sample/nishiwaki.egi

--
-- This file has been auto-generated by egison-translator.
--

def nishiwakiIf {a} (b: Bool) (e1: a) (e2: a) : a :=
  head
    (matchAll b as
      matcher
        | $ as something with
          | True -> [e1]
          | False -> [e2] with
      | $x -> x)

nishiwakiIf True 1 2

nishiwakiIf False 1 2

nishiwakiIf (1 = 1) 1 2

io (nishiwakiIf True (print "OK") (print "NG"))

io (nishiwakiIf False (print "NG") (print "OK"))

io (nishiwakiIf (1 = 1) (print "OK") (print "NG"))