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]
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?
Thankssubmitted by kevin_meredith
[link] [2 comments]
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]
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]
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! http://hackage.haskell.org/package/monoid-subclasses-0.4.0.4/docs/Data-Monoid-Factorial.htmlsubmitted by Spewface
[link] [2 comments]
Here's another solution to the problem I've seen going around lately (like here).
And here's an exercise: write a cryptogram solver!$ ./cryptarithm send more money [[9567,1085,10652]] $ ./cryptarithm three three two two one eleven [[84611,84611,803,803,391,171219]] submitted by MitchellSalad
[link] [1 comment]
My Haskell company, plaimi, is looking for some work after having our funding pulled. Do you need some Haskell hacking done? Do you know someone else who does? Perhaps do you need some Haskell teaching, or someone to run a seminar? Get in touch with us for any Haskell related stuff! :)
A little background on us at plaimi: We're three free software Haskell hackers located in Norway. We are somewhat experienced in this whole Haskell thing by now.
Two of us have been working on a project called tempuhs for the past year and a half or so. It's an ambitious Haskell consisting of a library and a REST server to let you chronologise events with high precision, and a sophisticated understanding of context. It's modular and decentralised, so anyone can run a session of it. It is very powerful. Our customers and funders used it for making nice interactive timelines of events.
We have some free software footprint, including (but not limited to) contributions to GHC and maintaining Haskell packages for the Gentoo-Haskell project.
If you're a company using Haskell or wanting to use Haskell, we could help you:
- convert programs from other languages to Haskell,
- write new programs,
- hack different tools in the Haskell ecosystem to your liking,
- write new tools where the Haskell ecosystem is lacking,
- & more.
So that's a bit about us and what we can do for you. If you have any questions, feel free to just post them here. I'm sorry that our website isn't very good. Get in touch if you have some work, or know someone that might do. :)alexander_b
[link] [17 comments]
The slides are available here.
The slides of other talks at the Leuven Haskell User Group can be found here.
BayHac 2015 is on Friday, June 12 to Sunday, June 14 this year!
Everyone with an interest in Haskell is invited to come! Come learn something new, work on that thing you have always wanted to do or get some help with that project you have.
The cost is free! It will be at the Hacker Dojo in Mountain View, CA.
The schedule will be packed full of 'Hac' with talks exploring a wide range topics.
See the Schedule in Real Time at http://bayhac.org.
If you would like to give a talk, send an email to firstname.lastname@example.org with the title and a brief explanation of what the talk will be on. It can be on anything Haskell related! We are also looking out for people who might be interested in conducting a more hands-on workshop.submitted by eegreg
[link] [1 comment]