This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- A proof of concept for a value-based debugging technique: instead of | |
| -- debugging by imperatively stepping through the evaluation, we instead | |
| -- produce a value representing the evaluation tree. | |
| -- | |
| -- This value can then be manipulated like any other value, e.g. instead adding | |
| -- a breakpoint and stepping until the breakpoint is hit, you can write an | |
| -- ordinary function which recurs into the evaluation tree until it finds a node | |
| -- of interest. This way, more complex conditions can be easily expressed, e.g. | |
| -- "find the smallest subtree in which a call of 'double' does not result in an | |
| -- output which is the double of its input". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Main where | |
| import Prelude (Unit, ($), (+), (<>), (<$>), (<*>), (==), (>), discard) | |
| import Effect (Effect) | |
| import Effect.Console (log) | |
| import Control.Category | |
| import Control.Semigroupoid | |
| import Data.Leibniz | |
| import Data.Maybe | |
| import Data.Exists |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# language KindSignatures #-} | |
| {-# language PolyKinds #-} | |
| {-# language DataKinds #-} | |
| {-# language TypeFamilies #-} | |
| {-# language RankNTypes #-} | |
| {-# language NoImplicitPrelude #-} | |
| {-# language FlexibleContexts #-} | |
| {-# language MultiParamTypeClasses #-} | |
| {-# language GADTs #-} | |
| {-# language ConstraintKinds #-} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module ADT; | |
| #package EXPORT::DEFAULT { }; | |
| grammar hs_adt { | |
| has @.typevars; | |
| rule TOP { | |
| $<name>=<.ident> <params> '=' <definers> | |
| } | |
| rule params { |