Given the above functions, I'm confused why let x = sumOfSquares . returnGreatest2 returnsbut sumOfSquares $ returnGreatest2 3 5 7 does the right thing. Since the type coming out of returnGreatest2 is the same as the type sumOfSquares expects, I would think I'd be able to compose them.

## Use 'any' to tell you true/false, if a list contains some value(s) divisible by 42

Having fun working through a Haskell tutorial... One problem posed is as you see in the subject line... this is one I'd really like to figure out, but I'm at a loss... I've used any like so:

## Performing algebra with newtypes based on integers Haskell

I'm having some trouble with performing simple addition, subtraction -- any kind of algebra really with Haskells newtype.

## Can my implementation of filter be improved?

An exercise in Haskell from First Principles says to implement filter using foldr and this is what I came up with but it feels and looks clunky. Is there a more natural way to implement it with a foldr?

## What makes two type expressions in Haskell equivalent?

So I was asked whether these 3 type expressions where equivalent in Haskell:if I take away the parenthesis I'm left with this

## Trying to implement “the essence of the iterator pattern”

I came across the paper "https://www.cs.ox.ac.uk/jeremy.gibbons/publications/iterator.pdf" which has code examples in quite an abstract pseudo haskell syntax.

## Tree or not (Haskell type understanding)

In "A Gentle Introduction to Haskell" we have such declaration of Tree's type:Let's to make some values of this type:

## Since Haskell is lazily evaluated, why doesn't this code work?

When I call safeHead with the argument (4:5:3:[]:[]) the pattern only evaluates the argument to see if either it is empty or if it has a head. So despite the nonsensical bit "[]:[]" it should not throw an error since this part is not even evaluated.

## Do the monadic liftM and the functorial fmap have to be equivalent?

(Note: I'm phrasing the question using Haskell terminology; answers are welcome to use the same terminology and/or the mathematical language of category theory, including proper mathematical definitions and axioms where I speak of functor and monad laws.)

## In Haskell, if a function returns a “Maybe a” type just so it is safe and total, how is it useful anymore?

So I have to define a safe version of the head function that would not throw an error when [] is passed as the argument. Here it is: