Skip to content

Instantly share code, notes, and snippets.

@minoki
Created September 5, 2019 09:04
Show Gist options
  • Save minoki/844ba88fc49afdf38bb56af8c52dd501 to your computer and use it in GitHub Desktop.
Save minoki/844ba88fc49afdf38bb56af8c52dd501 to your computer and use it in GitHub Desktop.
短絡評価の有無で停止するか否かが変わる例
module Main where
import Prelude
import Data.HeytingAlgebra
import Effect (Effect)
import Effect.Console (log)
foo :: forall a. HeytingAlgebra a => Unit -> a
foo x = foo x
bar :: Unit -> Boolean
bar _ = tt || foo unit
baz :: forall a. HeytingAlgebra a => Unit -> a
baz _ = tt || foo unit
main :: Effect Unit
main = do
log (show (bar unit :: Boolean))
log (show (baz unit :: Boolean))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment