calls and pattern matching --"*" fails without (*): main = print $ zipWith' * [ 1, 2, 3 ] [ 1, 2, 3 ] main = print $ zipWith' (*) [ 1, 2, 3 ] [ 1, 2, 3 ] --fails without "(..)": zipWith' f x:xs y:ys = f x y : zipWith f xs ys zipWith' f (x:xs) (y:ys) = f x y : zipWith f xs ys what the hell is: "Vector a =" data Vector a = Vector a a a deriving (Show) -XExistentialQuantification is required stan@ubu:/var/www/html/sand/DEV/lang/haskell/5-types$ ghci -XExistentialQuantification GHCi, version 7.10.3: http://www.haskell.org/ghc/ :? for help Prelude> data T = forall a. MkT ?? ghci> :set -XRankNTypes ============== may be good: https://stackoverflow.com/questions/3071136/what-does-the-forall-keyword-in-haskell-ghc-do https://downloads.haskell.org/~ghc/7.8.2/docs/html/users_guide/other-type-extensions.html#scoped-type-variables "insanely unclear": https://wiki.haskell.org/Scoped_type_variables 7.13.8. Lexically scoped type variables what is "rigid, or fully-known, type variable" ... please show use "non-rigid" type variable; unexpected: function binding and pattern binding are different: f1 :: forall a. [a] -> [a] f1 (x:xs) = xs ++ [ x :: a ] -- OK f2 :: forall a. [a] -> [a] f2 = \(x:xs) -> xs ++ [ x :: a ] -- OK f3 :: forall a. [a] -> [a] Just f3 = Just (\(x:xs) -> xs ++ [ x :: a ]) -- Not OK! f = runST ( (op >>= \(x :: STRef s Int) -> g x) :: forall s. ST s Bool ) forall s. ST s Bool type variable s is in scope, in the (op >>= \(x :: STRef s Int) -> g x). ?? what difference will it make if one erases "ST s Bool" ... what is this for? ============== what is "t" inside of [t] in following test: Prelude> :t ([]) ([]) :: [t] ============== this is a disaster: does not say "this is a type ''list''": Prelude> :t [a] :1:2: Not in scope: ‘a’ =============== why? instance Functor ((->)e) fmap = (.) fmap h (f a) = f( h a ) fmap h (f a) = f( h a ) = f . h a ... no. second arg of fmap is (f a) not a aka: instance Functor [] where -- fmap h [a] = [h a] fmap h (x:xs) = (h x):(fmap h xs)