equational-reasoning Questions

0

I'm trying to model Agda style equational reasoning proofs for Setoids (types with an equivalence relation). My setup is as follows: infix 1 :=: interface Equality a where (:=:) : a -> a -&gt...
Nipa asked 15/1, 2017 at 19:18

1

Solved

Can you prove that if return a = return b then a=b? When I use =, I mean in the laws and proofs sense, not the Eq class sense. Every monad that I know seems to satisfy this, and I can't think of a...
Harlequinade asked 25/1, 2016 at 23:24

3

Solved

Mind this program: {-# LANGUAGE RankNTypes #-} import Prelude hiding (sum) type List h = forall t . (h -> t -> t) -> t -> t sum_ :: (Num a) => List a -> a sum_ = \ list -> ...
Dionnadionne asked 11/8, 2015 at 0:45

2

Solved

Reading "Thinking Functionally with Haskell" I came across a part of a program calculation that required that map sum (map (x:) xss) be rewritten as map (x+) (map sum xss) Intuitively I know that ...
Delija asked 20/11, 2014 at 19:52

3

Does there exist a equation expander for Haskell? Something like foldr.com: 1+(1+(1+(1+(…))))=∞ I am new to Haskell I am having trouble understanding why certain equations are more preferable tha...
Hartwig asked 10/12, 2010 at 0:52

3

Solved

well, this is the definition of the filter function using foldr: myFilter p xs = foldr step [] xs where step x ys | p x = x : ys | otherwise = ys so for example let's say i have this function...
Distillate asked 2/2, 2010 at 16:10
1

© 2022 - 2024 — McMap. All rights reserved.