by kabes · 7y ago · 0 comments
It's interesting that you don't have this problem with Java, is it because Java always has types, while TS is lenient?
Regarding your syntax criticism: I quite agree. I really really like the path chosen by Haskell. Types are obviously a major part of Haskell, but there you just separate the type signature from the implementation.
emap :: (DynGraph gr) => (b -> c) -> gr a b -> gr a c
emap f = gmap (\(p,v,l,s)->(map1 f p,v,l,map1 f s))
where
map1 g = map (first g)
(Of course there are other helping things like type synonyms, which TS also supports) type UPath = [UNode][1]: http://hackage.haskell.org/package/fgl-5.7.0.1/docs/Data-Gra...