{-# options_ghc -Wno-partial-type-signatures #-} {-# language LinearTypes, PartialTypeSignatures, QualifiedDo #-} import Prelude () import Prelude.Linear import Data.Functor.Identity (Identity (runIdentity)) import Control.Functor.Linear as L implementation0 :: [Bool] implementation0 = let sections0 = [] (initials, sections1) = partition (== False) sections0 (layouts, sections2) = partition (== False) sections1 in sections2 <> sections2 <> initials <> layouts implementation1 :: [Bool] implementation1 = [] & \sections0 -> partition (== False) sections0 & \(initials, sections1) -> partition (== False) sections1 & \(layouts, sections2) -> sections2 <> sections2 <> initials <> layouts -- implementation2 :: [Bool] -- implementation2 = runIdentity $ do -- sections0 <- pure [] -- (initials, sections1) <- pure $ partition (== False) sections0 -- (layouts, sections2) <- pure $ partition (== False) sections1 -- pure $ sections2 <> sections2 <> initials <> layouts implementation3 :: [Bool] implementation3 = let (initials, layouts, sections2) = [] & ((\sections0 -> partition (== False) sections0 & ((\(initials, sections1) -> partition (== False) sections1 & ((\(layouts, sections2) -> (initials, layouts, sections2))::_ %1->_))::_ %1->_))::_ %1->_) in sections2 <> sections2 <> initials <> layouts implementation4 :: [Bool] implementation4 = let (initials, layouts, sections2) = runIdentity $ L.do sections0 <- pure [] (initials, sections1) <- pure $ partition (== False) sections0 (layouts, sections2) <- pure $ partition (== False) sections1 pure (initials, layouts, sections2) in sections2 <> sections2 <> initials <> layouts implementation5 :: [Bool] implementation5 = [] & \sections -> partition (== False) sections & \(initials, sections) -> partition (== False) sections & \(layouts, sections) -> sections <> sections <> initials <> layouts implementation6 :: [Bool] implementation6 = runIdentity $ do sections <- pure [] (initials, sections) <- pure $ partition (== False) sections (layouts, sections) <- pure $ partition (== False) sections pure $ sections <> sections <> initials <> layouts main :: IO () main = print implementation0