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
| -- I am designing an API. This is not real haskell code, but it is accepted by my tool. | |
| -- I can define type sigs as usual | |
| query :: Query a -> System -> [a] | |
| -- I can also write laws that the eventual implementation must satisfy. | |
| -- lines that begin with a string are laws. | |
| -- notice that these are _not even_ haskell definitions, because the LHS is not a pattern. | |
| "1" queryEntity ix (refine (const False) q) s = Nothing | |
| "2" queryEntity ix (refine (const True) q) = queryEntity ix q |
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 DeriveGeneric #-} | |
| {-# LANGUAGE PatternSynonyms #-} | |
| module Main where | |
| import GHC.Generics | |
| import Data.Void | |
| import Control.Applicative | |
| import Control.Arrow | |
| import Control.Monad.Trans.State |
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
| test = | |
| DifferenceR3 0.0 | |
| ( UnionR3 0.0 | |
| [ Translate3 (0.0, 0.0, -6.0) (Translate3 (-7.0, -7.0, -6.0) (CubeR 0.0 (14.0, 14.0, 12.0))) | |
| , UnionR3 0.0 | |
| [ UnionR3 0.0 | |
| [ Translate3 (0.0, 0.0, -5.0) (Translate3 (-5.0, -5.0, -5.0) (UnionR3 0.0 [])) | |
| , UnionR3 0.0 [UnionR3 0.0 [], UnionR3 0.0 []] | |
| ] |
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 BlockArguments #-} | |
| {-# LANGUAGE GADTs #-} | |
| {-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
| {-# LANGUAGE LambdaCase #-} | |
| {-# LANGUAGE ScopedTypeVariables #-} | |
| {-# LANGUAGE TypeApplications #-} | |
| {-# LANGUAGE ViewPatterns #-} | |
| module StateChart | |
| ( SC(SC) |
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 DeriveFunctor #-} | |
| {-# LANGUAGE DerivingStrategies #-} | |
| {-# LANGUAGE DerivingVia #-} | |
| {-# LANGUAGE GADTs #-} | |
| {-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
| {-# LANGUAGE ScopedTypeVariables #-} | |
| {-# LANGUAGE TupleSections #-} | |
| {-# LANGUAGE TypeApplications #-} | |
| {-# OPTIONS_GHC -Wno-orphans #-} |
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 OverloadedStrings #-} | |
| {-# LANGUAGE RecordWildCards #-} | |
| -- typechecking goes really fast if you uncomment this line | |
| -- {-# OPTIONS_GHC -fmax-valid-hole-fits=0 #-} | |
| module SlowTypecheck where | |
| import HsExpr |
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
| { | |
| "haskell.serverExecutablePath": "/home/sandy/prj/hls/.stack-work/install/x86_64-linux-tinfo6/95210f202fcc608b16b9b498dd9af8f1b8d43ff153fe428a250346ccc0cf33e5/8.8.4/bin/haskell-language-server", | |
| "haskell.formatOnImportOn": false, | |
| "haskell.plugin.tactics.config.features": "QrfgehpgNyy/HfrQngnPba/ErsvarUbyr/XabjaZbabvq/RzcglPnfr/QrfgehpgCha/Zrgncebtenz", | |
| "window.zoomLevel": 1, | |
| "files.exclude": { | |
| "**/.git": true, | |
| "**/.svn": true, | |
| "**/.hg": true, | |
| "**/CVS": true, |
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
| prepropEquivInterpreters | |
| :: forall effs x r1 r2 | |
| . (Eq x, Show x, Inject effs r1, Inject effs r2, Members effs effs) | |
| => (forall a. Sem r1 a -> IO a) | |
| -> (forall a. Sem r2 a -> IO a) | |
| -> (forall r. Members effs r => Gen (Sem r x)) | |
| -> Property | |
| prepropEquivInterpreters int1 int2 mksem = property $ do | |
| SomeSem sem <- liftGen @effs @x mksem | |
| pure $ ioProperty $ do |
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 BangPatterns #-} | |
| {-# LANGUAGE AllowAmbiguousTypes #-} | |
| {-# LANGUAGE DataKinds #-} | |
| {-# LANGUAGE DeriveAnyClass #-} | |
| {-# LANGUAGE DeriveDataTypeable #-} | |
| {-# LANGUAGE DeriveGeneric #-} | |
| {-# LANGUAGE DerivingStrategies #-} | |
| {-# LANGUAGE FlexibleContexts #-} | |
| {-# LANGUAGE FlexibleInstances #-} | |
| {-# LANGUAGE GADTs #-} |
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
| import qualified Data.Set as S | |
| import Data.Set (Set) | |
| import Data.Char (isLower) | |
| import Data.Ord (comparing, Down (Down)) | |
| import Data.List (sortBy, subsequences, minimumBy, maximumBy) | |
| import Control.Monad.Trans.Writer.CPS | |
| import Data.Monoid | |
| import Data.Foldable (traverse_) | |
| wordFilter :: String -> Bool |