This file contains 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 Rank2Types #-} | |
module Data.Machine.Dabbling | |
( unfoldPlan | |
) where | |
import Data.Machine | |
import Data.Profunctor.Unsafe ((#.)) |
This file contains 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
%default total | |
------------------------- | |
-- General stuff first: | |
------------------------- | |
decProofType : {a:Type} -> Dec a -> Type | |
decProofType {a} (Yes _) = a | |
decProofType {a} (No _) = a -> _|_ | |
This file contains 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
---------------------- | |
-- This is not recognized as a complete function, but produces a metavariable | |
-- instead. Fair enough, but... | |
---------------------- | |
myFalseElimFail : _|_ -> a | |
---------------------- | |
-- ... when trying to complete it with 'impossible', this weird error pops up: | |
-- Type checking ./bad-valids.idr | |
-- bad-valids.idr:14:18:myFalseElimFail' x is a valid case |
This file contains 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 | |
-- A fun experiment to try to implement vectors that would correspond to a fixed | |
-- size in underlying memory. Similar to the capacity of Go slices. | |
taken : Nat -> Nat -> Nat -> Nat | |
taken n max = (\v => if v+n > max then max + 8 else max) | |
-- data Fmv : (c : Nat) -> (m : Nat) -> (Nat -> Nat) -> Type -> Type where | |
-- fwv : (Vect c t) -> (m : Nat) -> Fmv c m (taken c m) t |
This file contains 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 | |
||| A fun experiment to try to implement vectors that would correspond to a fixed | |
||| size in underlying memory. Similar to the capacity of Go slices. | |
taken : Nat -> Nat -> Nat -> Nat | |
taken n max = (\v => if v+n > max then max + 8 else max) | |
--data Fmv : (c : Nat) -> (m : Nat) -> (Nat -> Nat) -> Type -> Type where | |
-- fwv : (Vect c t) -> (m : Nat) -> Fmv c m (taken c m) t |
This file contains 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
Warnings and error in 'make test' on commit aa392335ed70c4b05259e1c120b854e7865a9bb7 | |
$ make test | |
cabal haddock --executables --hyperlink-source --html --hoogle --html-location="http://hackage.haskell.org/packages/archive/\$pkg/latest/doc/html" --haddock-options="--title Idris" | |
Running Haddock for idris-0.9.12... | |
Running hscolour for idris-0.9.12... | |
Preprocessing library idris-0.9.12... | |
Preprocessing executable 'idris' for idris-0.9.12... | |
Preprocessing library idris-0.9.12... | |
Warning: The documentation for the following packages are not installed. No |
This file contains 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
mutual | |
data Foo : Type where | |
foo : Foo | |
fooey : (fooa:Foo) -> { default (foox fooa) foob : Foo } -> Foo | |
foox : Foo -> Foo | |
foox (fooey fa) = fa | |
foox f = f | |
{- |
This file contains 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
%default total | |
-------------------------------------------------------------------------- | |
-- First some generic stuff that will probably also be useful elsewhere: | |
-------------------------------------------------------------------------- | |
DecProofType : {a:Type} -> Dec a -> Type | |
DecProofType {a} (Yes _) = a | |
DecProofType {a} (No _) = a -> _|_ |
This file contains 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
[... snip ...] | |
0% ( 0 / 7) in 'Pkg.PParser' | |
60% ( 12 / 20) in 'Pkg.Package' | |
0% ( 0 / 9) in 'Idris.Transforms' | |
Warning: Idris.Colours: could not find link destinations for: | |
System.Console.ANSI.Common.Color | |
Warning: Idris.Core.TC: could not find link destinations for: | |
Control.Monad.Trans.Error.Error | |
Warning: Idris.Core.TT: could not find link destinations for: | |
Text.PrettyPrint.Annotated.Leijen.Doc Control.Monad.Trans.Error.Error Data.Text.Internal.Text Data.Vector.Unboxed.Base.Vector Util.Pretty.Pretty |
This file contains 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
%default total | |
-------------------------------------------------------------------------- | |
-- First some generic stuff that will probably also be useful elsewhere: | |
-------------------------------------------------------------------------- | |
DecProofType : {a:Type} -> Dec a -> Type | |
DecProofType {a} (Yes _) = a | |
DecProofType {a} (No _) = a -> _|_ |
NewerOlder