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]
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.
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
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]