foo :: Int -> [Int] foo n = [0..n] bar :: ((->) Int) [Int] bar = do xs <- foo pure (reverse xs) main = do print $ bar 2