Haskell

Haskell 中文群

u-jbefhaabe 5 months ago
那岂不是说haskell天然就支持
u-faadagjchb 5 months ago
@Kevin Jiang 可以mutable,但是不暴露出来。不让用户用
u-ibcgcebb 5 months ago
然后,闭包怎么办?生命期分析本身就是难点,不要觉得就简单了。
u-faadagjchb 5 months ago
这样做闭包会有啥问题呢?
u-faadagjchb 5 months ago
有没有啥例子可以说明
u-ibcgcebb 5 months ago
来一个haskell特色的:f x = let xs = x:xs in xs。问x xs的生命周期应该怎么分析?
u-facafichciiiheihbb 5 months ago
递归
u-facafichciiiheihbb 5 months ago
xs = x:xs = x:x:xs...无限续列加条件限制
u-faadagjchb 5 months ago
x不用分析,xs在定义的位置的作用域内
u-faadagjchb 5 months ago
x是外面进来的
u-ibcgcebb 5 months ago
还有一点是,作用域和生命周期没有半毛钱关系……(不说了 继续复习毛概
u-faadagjchb 5 months ago
有的吧,一个东西至少要在某个作用域里面才能被访问到
u-jebabbad 5 months ago
新人介绍啦
u-gffba 5 months ago
hmmm有这么狠的环节的吗
u-gffba 5 months ago
冰冰骗我进来的,听带佬们教育
u-gffba 5 months ago
gayhub id TisonKun
u-jebabbad 5 months ago
[emoji][emoji][emoji]
u-jebabbad 5 months ago
比冰冰年轻的吗
u-jebabbad 5 months ago
那就猜 True 了
u-gffba 5 months ago
侦测到网络分区,你的请求可能不会有回应
u-jfde 5 months ago
真的有gayhub的,被人骗进去过
u-hcfcahhi 5 months ago
tison也来玩了?
u-gffba 5 months ago
保罗锅锅
u-jebabbad 5 months ago
忘了说下这个群加了机器人备份了内容的,如果有私密的内容注意联系删除
u-gffba 5 months ago
archive地址在哪,刚好我看看之前聊过啥
u-jebabbad 5 months ago
fp-china.org 里面我加了个入口
u-jebabbad 5 months ago
最近刚加的
u-facafichciiiheihbb 5 months ago
KnownSymbol 这个typeclass是做什么作用的?
u-aehj 5 months ago
从 type 上的字符串获取运行时字符串
u-facafichciiiheihbb 5 months ago
感谢
u-facafichciiiheihbb 5 months ago
有没有啥好的方法合并两个tuple?
u-aehj 5 months ago
都换成 hlist
u-facafichciiiheihbb 5 months ago
print $ symbolVal (Proxy :: Proxy "symbolVal") -- ("symbolVal" :: Symbol) to ("symbolVal" :: String) 为什么这个Proxy的字符串是Symbol类型呢?String在Type里面就是Symbol吗?
u-jjibbjdi 5 months ago
kind是Symbol
u-facafichciiiheihbb 5 months ago
GHC allows us to use strings as types. Also known as Symbols.
u-facafichciiiheihbb 5 months ago
KnownSymbol 这个是GHC自动提供的吗?
u-jjibbjdi 5 months ago
是的 每个字符串字面量都有instance
u-facafichciiiheihbb 5 months ago
恩,好像理解了 Prelude Labels Language.Haskell.TH GHC.OverloadedLabels GHC.Base Data.Proxy GHC.TypeLits Data.Typeable> :t #a #a :: IsLabel "a" t => t Prelude Labels Language.Haskell.TH GHC.OverloadedLabels GHC.Base Data.Proxy GHC.TypeLits Data.Typeable> :i IsLabel class IsLabel (x :: Symbol) a where fromLabel :: a {-# MINIMAL fromLabel #-} -- Defined in ‘GHC.OverloadedLabels’ instance (l ~ l') => IsLabel l (Proxy l') -- Defined in ‘Labels.Internal’ Prelude Labels Language.Haskell.TH GHC.OverloadedLabels GHC.Base Data.Proxy GHC.TypeLits Data.Typeable> :t (#a := 3) (#a := 3) :: Num value => "a" := value
u-facafichciiiheihbb 5 months ago
(:=) :: KnownSymbol label => Proxy label -> value -> label := value #a :: Proxy "a" :: Proxy "a"
u-gffba 5 months ago
camelia太魔性了
u-facafichciiiheihbb 5 months ago
chat img
u-facafichciiiheihbb 5 months ago
:t symbolVal (Proxy :: Proxy $(varT (mkName "a"))) 请问一下这个句子哪里有错误?
u-facafichciiiheihbb 5 months ago
我发现了可以定义默认类型的方法了: {-# LANGUAGE ExtendedDefaultRules #-} default (Int) repl :: IO () print $ (encode (#a := 3, #b := 4))