News aggregator

Looking for fellow haskell beginners to learn Haskell over the summer!

Haskell on Reddit - Sat, 05/09/2015 - 10:14am

Hi : ) I'm a newcomer to Haskell and sometimes I need basic help that I cannot find on stackoverflow - plus I do not have a formal CS-background so certain things that might be obvious to more experienced people are totally over my head.

Is there anyone that was already planning on learning Haskell on their own over the summer who would like to make a learning-team with me? Either over the Internet or in person : )

------ EDIT -----

Thanks everyone for the great number of answers : ) I think that given that I am already working on a personal project while doing the Learn You a Haskell readings and exercises, the easiest way to work on this is going to be the #haskell IRC channel - so hop on it and let's code together !

submitted by teachmesomehaskell
[link] [21 comments]
Categories: Incoming News

The Unison Programming Platform

Lambda the Ultimate - Sat, 05/09/2015 - 6:31am

Unison - a next-generation programming platform, by Paul Chiusano:

  • Programs are edited in a (browser-based) semantic editor which guarantees programs are well-formed and typecheck by construction
  • The codebase is a purely functional data structure
  • The program is a UI, and UI interaction is programming
  • Persistent data sources must be accessible via a high-level, typed API

An interesting project mentioned in a comment a few weeks ago, it now has its own website and a more descriptive abstract overview explaining it's core premises.

Previous posts on Paul's blog are also of interest, and some feature videos demonstrating some aspects of Unison.

Categories: Offsite Discussion

Hands-on workshop on Haskell in Chennai on 15 May 2015

Haskell on Reddit - Sat, 05/09/2015 - 3:20am

Hi guys, we are organizing a beginners workshop on Haskell in Chennai. @shmunday designed a cool poster for the event. You can find it here. You can find the details about the workshop here.

The workshop is aimed at beginners. So, even if you haven't dabbled in functional programming or Haskell, it is totally fine. If you are an experienced Haskell developer, it'll be great to have you there to help us out and catch up. Please do drop by !

You can register to the workshop here.

submitted by arkhamist
[link] [comment]
Categories: Incoming News

Using ClassyPrelude to handle either Text orByteString

haskell-cafe - Fri, 05/08/2015 - 9:10pm
Ok, I can't seem to figure out how to make this work, and since I'm using ClassyPrelude (from classy-prelude, latest version on hackage as of yesterday), I think cafe is a better place to ask than beginners. Sorry if this should have gone there. I want to read in a list of files, concatenate them, and then run the resulting data through a "process" function. So far, no problem. Given an opts record that contains the list of files and some control for the process function, this expression works: hPut stdout =<< process opts . concat <$> mapM (readFile . fpFromString) (files opts) (BTW, recommendations on cleaning that up gratefully accepted) However, I'd like to be able to read them all as either Text or ByteString, depending on options being passed to me. This doesn't work so well. If I give process a type of Text -> Text or ByteString->ByteString, everything works fine with no other changes. However, any attempt to make it polymorphic fails with ambiguous type warnings. I've tried a slew of things, and
Categories: Offsite Discussion

ICFP 2015 Accepted papers

Haskell on Reddit - Fri, 05/08/2015 - 6:41pm
Categories: Incoming News

Lispers of Haskell: What's Your Experience Using Haskell versus a Lisp? (x-post on /r/lisp)

Haskell on Reddit - Fri, 05/08/2015 - 3:05pm

For those of you who have past or current experience using a lisp--be it Scheme, Common Lisp, Clojure, or another--what is your experience using that lisp in comparison to and contrast with Haskell?

This is an extremely broad question, so if I were forced to more specificity I might ask some of the following:

  • What types of projects do you find more suited to one language over the other?
  • How does the prototyping experience differ for you in each?
  • How abour the debugging experience?
  • Are there significant differences in library availability?
  • What differences do you find within the communities?
  • How does your workflow differ?
  • How readable/maintainable is the average code to the average skilled lisper/haskeller?
  • Have you experienced significant differenes when collaborating in each?

Really, though, any and all experiences and input will be much appreciated.

submitted by xelxebar
[link] [105 comments]
Categories: Incoming News

"Find the 51 billionth letter ..."

Haskell on Reddit - Fri, 05/08/2015 - 2:48pm

Typeclassopedia mentioned this interesting programming puzzle:

If the integers from 1 to 999,999,999 are written as words, sorted alphabetically, and concatenated, what is the 51 billionth letter?

With the following approach, my program ran for over 8 hours without terminating:

findFiftyOneBillion :: Char findFiftyOneBillion = findCharAtIndex fiftyOneBillion findCharAtIndex :: Integer -> Char findCharAtIndex idx = head . drop' (idx - 1) . concat . sort . map integerToWord $ [1..999999999] drop' :: Integer -> [a] -> [a] -- omitted integerToWord :: Integer -> String -- omitted

In the problem description, I don't see an upper time bound for how long it should take to solve this problem.

However, I'm highly confident that my approach is not the best way.

Can someone please give me a hint to solve this problem?


submitted by kevin_meredith
[link] [2 comments]
Categories: Incoming News

at last, Debian unstable has working arm ghci and TH

Haskell on Reddit - Fri, 05/08/2015 - 2:45pm
joey@darkstar:~$ dpkg --print-architecture armhf joey@darkstar:~$ ghci GHCi, version 7.8.4: :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Prelude> :m Control.Concurrent.Async Prelude Control.Concurrent.Async> let celebrate s = putStr s >> celebrate s Prelude Control.Concurrent.Async> celebrate "ghci" `race` celebrate "debian-arm" Loading package array- ... linking ... done. Loading package stm-2.4.4 ... linking ... done. Loading package async-2.0.2 ... linking ... done. debgihacni-agrhmcidegbhicain-gahrcmidgehbciiang-hacrimgdhecbiiagnh-cairmghdceibigahnc- iargmhcdiebgihacni-agrhmcidegbhicain-gahrcmidgehbciiang-hacrimgdhecbiiagnh-cairmghdcei bigahnc-iargmhcdiebgihacni-agrhmcidegbhicain-gahrcmidgehbciiang-hacr

This has been a long time coming. My heartfelt thanks to both the ghc and debian developers who got it there. I only wish I hadn't failed in my attempt to get this version of ghc into Debian last fall, in time for the recent release.

submitted by joeyh
[link] [10 comments]
Categories: Incoming News

Automatic liftIO or how to write this shorter?

haskell-cafe - Fri, 05/08/2015 - 12:20pm
Hello haskell-cafe< at > I'm writing a GUI app in Haskell and bindings to the widget toolkit i'm using in parallel. These bindings are very simple and all its functions have return type (IO something). So far so good, i wrote the following code to create an config window: createConfigUI root = do box <- Box.add root -- first field addToPackEnd box =<< do f <- Fr.add box setPartText f Nothing "E-mail" setPartContent f Nothing =<< do box <- Box.add box addToPackEnd box =<< do e <- Ent.add box Ent.singleLineSet e True -- Here onEvent "changed,user" e $ do reactOnUserInput e objectShow e return e objectShow box return box objectShow f return f -- next field addToPackEnd box =<< do ... Initially, i was quite satisfied with flipped bind use for creating UI elements and arranging th
Categories: Offsite Discussion

Preserving types

Haskell on Reddit - Fri, 05/08/2015 - 1:22am

This is by no means a Haskell problem, but it's the kind of problem I think the people here would be particularly interested in solving. After spending time on properly expressing my logic in the type system on my server, I basically just throw it all out the window when I send the data over JSON, only to try to reproduce the type structure again in some other language when I parse it.

Writing all of the type and parsing logic in two (or more) languages is not only uninteresting and a pain in the ass, it's also really bug-prone, and after you've done it, it makes you feel like you have type guarantees when you actually don't.

For plain data types, this just feels so dirty, especially when the data type just consists of some basic structs, tuples, and enums, which translate pretty much identically between languages like Rust, Haskell, and Swift (although Swift does have full emoji support in the type declarations!)

Has there been any work done on / is there any interest in a cross-language type system, even if it just has basic algebraic data types and a few standard primitives? Even at this simple level, type safety across language barriers would be really nice.

submitted by dnkndnts
[link] [40 comments]
Categories: Incoming News

Efficient memory use for tens of thousands ofconnections

haskell-cafe - Fri, 05/08/2015 - 1:12am
I'm currently evaluating memory overhead for a variety of simple Websocket based echo server to get a gauge of minimal memory penalty per connection along with SSL overhead per connection. I've created two websocket servers in Haskell: One using Yesod + jaspers Websockets lib, the other with Yesod + Mishael Snoyman's native websocket lib. I was curious what options I might be missing that would ensure a more efficient use of memory, at the moment the non-SSL seems to use about 48kb per connection, while using Haskell's TLS via warp-tls introduces a huge amount of overhead (along with odd handshake issues). Here's what my results look like: No SSL Program started. Tester started. Tester finished connecting. Waiting: 360 Last Memory Increase: 2 WARNING: Program hasn't stopped increasing. Started with: 2633728 Ended with: 50896896 kB per connection: 47.13 SSL Program started. Tester started. yesod-customws-tls: HandshakeFailed (Error_Protocol
Categories: Offsite Discussion

Can we make Sum and Product... Foldable?

Haskell on Reddit - Thu, 05/07/2015 - 10:41pm

I know they're not operationally polymorphic (restricted to numbers), but I still would find it interesting to see:

-- | I know, I didn't put proper constraints :\ foldrSum :: (a -> b -> b) -> b -> Sum a -> b foldrSum f acc (Sum 0) = acc foldrSum f acc (Sum n) | n > 0 = f n $ foldrSum f $ Sum $ n-1 | otherwise = f n $ foldrSum f $ Sum $ n+1 primeFactors x = let (xs1, xs2) = unzip [(n, x `div` n) | n <- [2..intSqrt n], x `mod` n == 0] in nub $ xs1 ++ xs2 ++ [x] -- remove duplicate from square numbers where intSqrt = floor . sqrt . fromIntegral -- | Nor did I here foldrProduct :: (a -> b -> b) -> b -> Product a -> b foldrProduct f acc (Product 1) = acc foldrProduct f acc (Product n) = let ns = primeFactors n in f n $ foldrProduct f $ Product $ n / head ns

So Sum is something like a distance away from 0, and the catamorphism's normalization (correct?) simply approaches 0, and Product depends on unique prime factors to comprise the number - where if n is my test case, then deconstructing n should prolong 1 * n = n until the base case as well.

EDIT: Here's a cool thing I found after looking!

submitted by Spewface
[link] [2 comments]
Categories: Incoming News