News aggregator

Implementation of "until"

libraries list - Sun, 11/09/2014 - 9:14pm
I got to looking at the `until` function (in GHC.Base):
Categories: Offsite Discussion

Can I check the length in a guarded expresion

haskell-cafe - Sun, 11/09/2014 - 8:33pm
Hello, I try to make a guarded solution to find the last item in a list. I thought I could do something like this | length a == 1 = a But then I see a lot of error messages. Is there another way I can check the length of a list with guards ? Roelof
Categories: Offsite Discussion

xs not in scope

haskell-cafe - Sun, 11/09/2014 - 6:38pm
Hello, Im trying to find several answers to problem1 of the 99 haskell problems. Find the last item in a list. Now im trying to find a guarded solution. So far I have this: last3::[a]-> Maybe a; last3 a | [] = Nothing | ([a]) = Just a | (_:xs) = last3 xs But I see this error messages : src/Main.hs< at >10:8-10:10Not in scope: xs How to solve this ? Roelof
Categories: Offsite Discussion

Simon Peyton Jones - YouTube - Sun, 11/09/2014 - 6:06pm
Categories: Offsite Blogs

Church Numerals - Sun, 11/09/2014 - 5:06pm
Categories: Offsite Blogs

Church Numerals - Sun, 11/09/2014 - 5:06pm
Categories: Offsite Blogs

Search | Channel 9 - Sun, 11/09/2014 - 4:42pm
Categories: Offsite Blogs

Looking for papers/resources/keywords on JIT, supercompilation etc. and their applicability on GHC/Haskell

Haskell on Reddit - Sun, 11/09/2014 - 3:38pm

Hi all,

I'm wondering about possible compile-time and runtime optimization techniques that we can apply to Haskell/GHC. I knew JITs for a long time and recently learned about supercompilation in one of the posts in this subreddit. The paper in the link showed great results but those are not applied to GHC(I think a subset of Haskell is implemented from scratch for demonstration).

I was wondering (apart from requiring huge amounts of work) what are problems with applying those techniques to Haskell. I'm looking for papers about those techniques in Haskell context, and papers of similar techniques. Can anyone point me some papers/resources/keywords about those?


submitted by semanticistZombie
[link] [6 comments]
Categories: Incoming News

Preprints for POPL 2015

Haskell on Reddit - Sun, 11/09/2014 - 3:28pm
Categories: Incoming News

Has there ever been attempts at a functional OS including functional file system?

Haskell on Reddit - Sun, 11/09/2014 - 2:40pm

Instead of an OS where everything is deemed a noun (the file) even if a function or dynamic stream, perhaps go the other way where the standard atomic unit of reference is the function. Everything is a function, of course all functions can be the input of some other function.

Directories could be replaced with categories and data types removing the need for the kludged alias. File names need not be used, each file is given a UID or UUID name, the latter being perhaps a hash function, which would mean non destructive data editing. OS processes and src functions can also be named via a hash scheme, and thus referenced by hash in the actual source code (with local human readable aliases). Instead of foo() where foo can change, referencing some hash may be advantageous—any function can self regulate for consistency.

Just some naive thoughts.

submitted by lstwhl
[link] [29 comments]
Categories: Incoming News

IO and exceptions

haskell-cafe - Sun, 11/09/2014 - 2:08pm
Hi all, I'm having some trouble with IO functions and exceptions. When I call an IO function in Haskell, I feel very uncomfortable, because you never know what kind of exceptions your function may throw. There are a lot of cases where thrown exceptions are not specified in the documentation. What's worse, there are cases where it's impossible to catch thrown exceptions in a safe way. Example to not knowing what exceptions may be thrown: `readChan` blocks the thread until it reads something. But what happens when channel is closed while one thread is blocked to read? It's not mentioned in the documentation and it's not specified in terms of types. (e.g. by using Either, Maybe or similar) Example to not being able to catch the exception: `recvFrom` blocks the thread until it reads something. However, what happens if socket is closed while `recvFrom` i
Categories: Offsite Discussion

First morning with Haskell, a few early confusions

Haskell on Reddit - Sun, 11/09/2014 - 12:11pm

This morning I've finally had some time to start learning Haskell, and after only a few minutes, I've encountered a few aspects of the language that have left me baffled. FYI, I have a small amount of FP experience (light exposure to Clojure, but I make extensive use of procs/lambdas in Ruby and Python).

First, why can't we use prefix notation for built-in functions? If ++, !! and the like are functions, why is:

list1 ++ list2

valid syntax while

++ list1 list2

is not?

Why is it that prepending an item to a list with the cons operator is fast, but appending requires traversal of the entire list? As a corollary, why isn't there an equivalent to:


I understand that this isn't valid because the first argument to the cons function is an element, and the second is a list. I'm just curious as to why there is no built-in append function.

Why does list comparison return a scalar instead of a list? But more importantly, why on Earth does this expression evaluate to True?

[3,4,2] > [3,4]

Supposedly, list comparison operates in lexicographical order. 3 > 3 is clearly false, as is 4 > 4. The only thing left is to compare element 3 of the first list to...what?

[3,4] !! 2

isn't a valid expression, so

( [3,4,2] !! 2 ) > ( [3,4] !! 2 )

shouldn't evaluate to True, unless I'm missing something here.

Are there logical explanations for these behaviors?

submitted by jakeytrojan
[link] [13 comments]
Categories: Incoming News

Annotations: status and documentation

glasgow-user - Wed, 11/05/2014 - 10:21pm
I would like to be able to retrieve user-supplied annotations in Template Haskell. The 7.8 user manual doesn't mention this ability. However, I see this Trac page: Where it appears that this feature may exist in 7.8. I will gladly tinker with annotations and update the user manual if someone will help me understand what the situation is. On a related note, it looks like this patch pointed to from the Wiki page for annotations got ignored. Should i submit it to phabricator? Thanks, Greg Weber _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users< at >
Categories: Offsite Discussion

New gtk2hs 0.12.4 release

gtk2hs - Wed, 11/21/2012 - 12:56pm

Thanks to John Lato and Duncan Coutts for the latest bugfix release! The latest packages should be buildable on GHC 7.6, and the cairo package should behave a bit nicer in ghci on Windows. Thanks to all!


Categories: Incoming News