-
-
Save nikivazou/1c134d34830e73c62cc5e18b8b7c8e98 to your computer and use it in GitHub Desktop.
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
{-@ LIQUID "--reflection" @-} | |
{-@ LIQUID "--ple" @-} | |
module FstBug where | |
import Data.Set hiding (map) | |
import Prelude hiding (map, fst) | |
{-@ fstBug :: xys:[(a,b)] | |
-> x: {a | member x (fromList (map fst xys))} | |
-> () @-} | |
fstBug :: Ord a => [(a,b)]-> a -> () | |
fstBug xys x = assert (member x (fromList (map fst xys))) () | |
{-@ reflect map @-} | |
map :: (a -> b) -> [a] -> [b] | |
map f [] = [] | |
map f (x : xs) = f x : map f xs | |
{-@ reflect fst @-} | |
fst :: (a, b) -> a | |
fst (x, y) = x | |
{-@ assert :: b:{Bool | b } -> a -> a @-} | |
assert :: Bool -> a -> a | |
assert _ x = x | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment