Monday, 6 June 2016

Haskell: Get all even numbers which are greater than 6.

Prelude> let retainEvenGreaterSix es = [n | n<- es, isEven n, (n>6)]
Prelude> retainEvenGreaterSix [1, 3, 2, 4, 5, 7, 6, 8, 10]
[8,10]

Previous                                                 Next                                                 Home

No comments:

Post a Comment