Search Results

Search found 1 results on 1 pages for 'kunkelwe'.

Page 1/1 | 1 

  • Nested Lambdas in wxHaskell Library

    - by kunkelwe
    I've been trying to figure out how I can make staticText elements resize to fit their contents with wxHaskell. From what I can tell, this is the default behavior in wxWidgets, but the wxHaskell wrapper specifically disables this behavior. However, the library code that creates new elements has me very confused. Can anyone provide an explanation for what this code does? staticText :: Window a -> [Prop (StaticText ())] -> IO (StaticText ()) staticText parent props = feed2 props 0 $ initialWindow $ \id rect -> initialText $ \txt -> \props flags -> do t <- staticTextCreate parent id txt rect flags {- (wxALIGN_LEFT + wxST_NO_AUTORESIZE) -} set t props return t I know that feed2 x y f = f x y, and that the type signature of initialWindow is initialWindow :: (Id -> Rect -> [Prop (Window w)] -> Style -> a) -> [Prop (Window w)] -> Style -> a and the signature of initialText is initialText :: Textual w => (String -> [Prop w] -> a) -> [Prop w] -> a but I just can't wrap my head around all the lambdas.

    Read the article

1