recentpopularlog in

Haskell

« earlier   
Learning Haskell - HaskellWiki
1 Training courses
2 Material for self-study
2.1 Textbooks
2.2 Online tutorials
2.3 Advanced tutorials
2.4 Debugging/profiling/optimization
2.5 Monads
2.6 Type classes
2.7 Generic programming
2.8 Popular libraries
2.9 Reference
2.10 Course material
3 Trying Haskell online
haskell  list  links  books  resources  learning 
9 hours ago by dicewitch
Tutorials - HaskellWiki
1 Introductions to Haskell
1.1 Best places to start
1.2 Other tutorials
2 Motivation for using Haskell
3 Blog articles
4 Practical Haskell
4.1 Testing
5 Reference material
6 Comparisons to other languages
7 Teaching Haskell
8 Using monads
8.1 Tutorials
9 Workshops on advanced functional programming
tutorial  haskell  list 
9 hours ago by dicewitch
mapping - Haskell: how to map a tuple? - Stack Overflow
Searching at Hoogle gives no exact matches for (a -> b) -> (a, a) -> (b, b), which is the type you require, but it is pretty easy to do yourself:

mapTuple :: (a -> b) -> (a, a) -> (b, b)
mapTuple f (a1, a2) = (f a1, f a2)
Note, you will have to define a new function for 3-tuples, 4-tuples etc - although such a need might be a sign, that you are not using tuples like they were intended: In general, tuples hold values of different types, so wanting to apply a single function to all values is not very common
haskell  stack_overflow 
13 hours ago by dicewitch
Division in Haskell - Stack Overflow
Use div, which performs integer division:

halfEvens :: [Int] -> [Int]
halfEvens [] = []
halfEvens (x:xs) | odd x = halfEvens xs
| otherwise = x `div` 2 : halfEvens xs
The (/) function requires arguments whose type is in the class Fractional, and performs standard division. The div function requires arguments whose type is in the class Integral, and performs integer division.

More precisely, div and mod round toward negative infinity. Their cousins, quot and rem, behave like integer division in C and round toward zero. div and mod are usually correct when doing modular arithmetic (e.g. when calculating the day of the week given a date), while quot and rem are slightly faster (I think).

Playing around a bit in
haskell  math  arithmetic  stack_overflow  operators 
13 hours ago by dicewitch
types - Difference between `data` and `newtype` in Haskell - Stack Overflow
There are several key differences.

Representation

A newtype guarantees that your data will have exactly the same representation at runtime, as the type that you wrap.
While data declares a brand new data structure at runtime.
So the key point here is that the construct for the newtype is guaranteed to be erased at compile time.
haskell  types  stack_overflow 
13 hours ago by dicewitch
roman/Haskell-development-workflows: Slides and dot GHCi file from the presentation
This are the slides from the FP Complete webinar Haskell Development Workflows presented on Oct 17th. 2018
haskell  slides 
14 hours ago by nicolashery

Copy this bookmark:





to read