Function Composition

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Function Composition

Chris Witte
Can anyone explain why Shape.Polygon would have a different type to
(Shape).Polygon, I thought the brackets would be redundant. Here is
the output from a Hugs session

Animation> :v
-- Hugs Version 20050113
Animation> :t Shape
Shape :: Shape -> Region
Animation> :t Polygon
Polygon :: [Vertex] -> Shape
Animation> :t (Shape.Polygon)
Polygon :: [Vertex] -> Shape
Animation> :t ((Shape).Polygon)
Shape . Polygon :: [Vertex] -> Region
Animation> :t Shape.(Polygon)
Shape . Polygon :: [Vertex] -> Region


Cheers
Chris Witte
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Function Composition

Andres Loeh-2
> Can anyone explain why Shape.Polygon would have a different type to
> (Shape).Polygon, I thought the brackets would be redundant. Here is
> the output from a Hugs session
>
> Animation> :v
> -- Hugs Version 20050113
> Animation> :t Shape
> Shape :: Shape -> Region
> Animation> :t Polygon
> Polygon :: [Vertex] -> Shape
> Animation> :t (Shape.Polygon)
> Polygon :: [Vertex] -> Shape
> Animation> :t ((Shape).Polygon)
> Shape . Polygon :: [Vertex] -> Region
> Animation> :t Shape.(Polygon)
> Shape . Polygon :: [Vertex] -> Region

Shape.Polygon is a qualified name, and you probably have a module
called Shape. Use spaces around the dot ...

Cheers,
  Andres
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe