hello Haskell the holidays are coming up soon and I think this can help
http://www.news13open.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
hello Haskell ever since I started this my life has been better than ever
http://www.news13open.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
hey Haskell I didn't believe this at all until I started
http://www.news13wise.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
hey Haskell this is nuts http://www.business10i.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
hey Haskell check it out http://www.fastnews10i.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
hey Haskell i cant believe this http://www.fastnews10i.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
hey Haskell this is sick http://www.bestsource10.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Can someone provide a hand calculation of:
span ( 0) [-1, -2, -3, 0, 1, 2, -3, -4, -5]?
I know the result is ([-1, -2, -3], [0, 1, 2, -3, -4, -5]), but the recursion
flummoxes me.
Here's the Prelude definition:
mySpan :: (a - Bool) - [a] - ([a], [a])mySpan _
[]
What's the cleanest definition for a function f :: [a] - [a] that takes a list
and returns the same list, with alternate items removed? e.g., f [0, 1, 2, 3,
4, 5] = [1,3,5]?
_
The New
Say I've got a type Month declared as an instance of the Enum class, and a
type MonthPair declared as a pair of months:
data Month = January | February
| March | April
|
Given the following definition of either, from the prelude:
either :: (a - c, b - c) - Either a b - c
either (f, g) (Left x) = f xeither (f, g) (Right x) = g x
what's a clean proof that:
h . either (f, g) = either (h . f, g . h)?
The only proof I
Correction: the theorem is
h . either (f, g) = either (h . f, h . g)
(Thanks to Lennart for pointing out the typo.)
From: rj248...@hotmail.com
To: haskell-cafe@haskell.org
Subject: Clean proof?
Date: Sun, 23 May 2010 15:41:20 +
Given the following definition of either, from the
Why does the following, trivial code snippet below hang GHCi when I
typeScalene Failure, and what's the fix?
data Triangle = Failure |
Equilateral | Isosceles
| Scalene
I'm trying to prove that (==) is reflexive, symmetric, and transitive over the
Bools, given this definition:
(==) :: Bool - Bool - Boolx == y =
(x y) || (not x not y)
My question is: are the proofs below for reflexivity and symmetricity
rigorous,
I'd like to make Day an instance of class Enum, but the definition of
toEnum below seems to be completely wrong, because integers seem not permit
pattern matching. How is toEnum defined? Thanks.
data Day = Sunday | Monday
Is this how a rigorous Haskeller would lay out the proofs of the following
theorems? This is Bird 1.4.6.
(i)
Theorem: (*) x = (* x)
Proof:
(*) x ={definition of partial application} \y - x * y =
{commutativity of *} \y - y * x =
This is another proof-layout question, this time from Bird 1.4.7.
We're asked to define the functions curry2 and uncurry2 for currying and
uncurrying functions with two arguments. Simple enough:
curry2 :: ((a, b) - c) - (a - (b - c))curry2 f x y = f
(x, y)
uncurry2
Bird problem 1.6.2 is:
If f :: (a, b) - c, then define a function swap such that:
flip (curry f) = curry (f . swap).
I'd very much appreciate if someone could tell me whether there's a rigorous
solution simpler than mine, which is:
Since (.) :: (q - r) - (p - q) - (p - r), we have f :: q - r and
Bird 1.6.3 requires deducing type signatures for the functions strange and
stranger.
Are my solutions below correct?
(i) strange f g = g (f g)
Assume g :: a - b. Then f :: (a - b) - c. But since g :: a - b,f g :: a,
so c = a. Therefore, f :: (a - b) - a, and g (f g) :: a.Therefore, strange
Newbie trying to get through Bird. Could someone provide a clean solution,
with proof (so I can see how these proofs are laid out), to this:
Given:
f :: Integer - Integerg :: Integer - (Integer - Integer)
h :: ...h x y = f (g x y)
Questions:
a. Fill in the type assignment for h.
b. Which of
What are some simple functions that would naturally have the following type
signatures:
f :: (Integer - Integer) - Integer
g :: (Integer - Integer) - (Integer - Integer)
(Bird problem 1.4.5)
Could someone provide the status and expected release date of the Haskell
Platform for Snow Leopard (Mac OS X 10.6.2)?
Thanks.
_
Your E-mail and More On-the-Go. Get Windows Live Hotmail
What's the cleanest way to fully uninstall GHC on a Mac running Snow Leopard?
Running Library/Frameworks/GHC.framework/Tools/Uninstaller from an account with
admin privileges produced the following, surprising error message:
GHC.framework installer must be run with admin privileges Prefix
I'm trying to prove the following duality theorem of fold for finite lists:
foldr f e xs = foldl (flip f) e (reverse xs)
where
reverse :: [a] - [a]
reverse [] = []
reverse (x:xs) = reverse xs ++ [x]
flip :: (a - b - c) - b
The following theorem is obviously true, but how is it proved (most cleanly and
simply) in Haskell?
Theorem: (nondecreasing xs) = nondecreasing (insert x xs), where:
nondecreasing :: (Ord a) = [a] - Bool
nondecreasing []= True
nondecreasing xxs@(x : xs) =
I need to write an implementation using foldl, and a separate implementation
using foldr, of a function, remdups xs, that removes adjacent duplicate items
from the list xs. For example, remdups [1,2,2,3,3,3,1,1]= [1,2,3,1].
My approach is first to write a direct recursion, as follows:
This Bird problem vexes me, in the first instance because it doesn't seem to
specify a unique solution:
Given a list xs = [x_1, x_2, . . . , x_n], the sequence of successive maxima
ssm xs is the
longest subsequence [x_j1, x_j2, x_j3..x_jk] such that j_1 = 1 and j_m j_n =
x_jm x_jn.
For
Can someone provide the induction-case proof of the following identity:
foldl (-) ((-) x y) ys = (foldl (-) x ys) - y
If foldl is defined as usual:
foldl :: (b - a - b) - b - [a] - b
foldl f e [] = e
foldl f e (x : xs) = myFoldl f (f e x) xs
The
Can someone provide a complete hand calculation of zip [1,2,3] [4,5,6] using
the following definition of zip, based on foldr:
zip::[a] - [b] - [(a, b)]
zip=foldr f e
where
e ys=[]
f x g [ ]=[]
f x g (y : ys)=(x , y) : g ys
foldl and foldr are defined as follows:
foldr:: (a - b - b) - b - [a] - b
foldr f e [] = e
foldr f e (x : xs) = f x (foldr f e xs)
foldl:: (b - a - b) - b - [a] - b
foldl f e [] = e
foldl f e (x : xs) = foldl f (f e x) xs
1.
Given a list of decimal digits represented by Integers between 0 and 9--for
example, the list [1,2,3, 4]--with the high-order digit at the left, the list
can be converted to a decimal integer n using the following formula, an
instance of Horner's rule:
n = 10 * 10 * 10 * 1 + 10
Can anyone help with this problem from Bird:
a. Convert the following list comprehensions to combinatory style:
i. [(x, y) | x - [1..n], odd x, y - [1..n]]
ii. [(x, y) | x - [1..n], y - [1..n], odd x]
b. Are they equal?
c. Compare the costs of evaluating the two expressions.
I
Here's another Bird problem that's stymied me:
The function inits computes the list of initial segments of a list; its type
is inits :: [a] - [[a]]. What is the appropriate naturality condition for
inits?
The only discussion in the text concerning naturality conditions concerns map,
where
Given the following (usual) definition of map:
map:: (a - b) - [a] - [b]
map f [] = []
map f (x : xs) = f x : map f xs
What's the type of map map?
GHCi's :t command reveals:
*Main :t map map
map map :: [a - b] - [[a] - [b]]
I'd be grateful if
I can calculate non-nested list comprehensions without a problem, but am unable
to calculate nested comprehensions involving, for example, the generation of a
list of pairs where the first and separate elements are drawn from two separate
lists, as in:
[(a, b) | a - [1..3], b - [1..2]]
Could someone provide an elegant solution to Bird problem 4.2.13?
Here are the problem and my inelegant solution:
Problem
---
Since concatenation seems such a basic operation on lists, we can try to
construct a data type that captures
concatenation as a primitive.
For example,
data
Could someone provide an elegant solution to Bird problem 4.2.13?
Here are the problem and my inelegant solution:
Problem
---
Since concatenation seems such a basic operation on lists, we can try to
construct a data type that captures
concatenation as a primitive.
For example,
data
37 matches
Mail list logo