我有兩個密切相關的問題: 首先,如何能在Haskell的箭類建模/在阿格達代表? class Arrow a where
arr :: (b -> c) -> a b c
(>>>) :: a b c -> a c d -> a b d
first :: a b c -> a (b,d) (c,d)
second :: a b c -> a (d,b
我剛剛閱讀的文章Creative uses of monads,這是很有趣的想法和引用擁擠,所以我很好奇:箭頭呢? 我不是在尋找關於個人意見或基準或「標準」用途的參考(如在monads vs arrows或help understanding arrows in haskell中),而是尋找智能和/或非平凡應用程序的引用列表(可能在研究論文中)? 。謝謝。
在此之後page scraping tutorial筆者得到所有圖片的集合頁面上進行如下: css :: ArrowXml a => String -> a XmlTree XmlTree
css tag = multi (hasName tag)
images tree = tree >>> css "img" >>> getAttrValue "src"
如何我只得到,比如,頁面上的
爲ArrowLoop函數實例包含 loop :: ((b,d) -> (c,d)) -> (b -> c)
loop f b = let (c,d) = f (b,d) in c
首先,我有簽名一個問題:我們怎麼可能從(b,d) -> (c,d)得到b -> c?我的意思是,產生的元組中的c可能取決於輸入的兩個元素,怎樣才能「切斷」d的影響? 其次我不明白let如何在這裏工作。不包含(c,d
我正在嘗試與箭頭合作&,並且遇到了一些困難。我有一個上下文,我需要一個Arrow [a] [b],我想寫一個Arrow a b並將其映射/排列在箭頭內,即la mapM。具體來說,箭頭是一個Hakyll Compiler,但我認爲這對於答案沒有多大意義。 鑑於箭頭 myInnerArrow :: Arrow a => a b c
我怎樣才能解除這種成箭頭 myOuterArrow :: Arr