Topological sort: Difference between revisions

m
→‎{{header|Haskell}}: Used Data.Bifunctor in place of Control.Arrow
m (added to a category.)
m (→‎{{header|Haskell}}: Used Data.Bifunctor in place of Control.Arrow)
Line 2,442:
=={{header|Haskell}}==
<lang haskell>import Data.List ((\\), elemIndex, intersect, nub)
import ControlData.ArrowBifunctor ((***)bimap, first)
 
combs 0 _ = [[]]
Line 2,472:
| otherwise = foldl makePrecede [] dB
where
dB = ((\(x, y) -> (x, y \\ x)) . (bimap return *** words)) <$> xs
makePrecede ts ([x], xs) =
nub $
9,655

edits