草庐IT

haskell-platform

全部标签

android - 无法从 SDK 管理器安装 "Android SDK Platform Tools"

安装过程中显示以下错误:Doneloadingpackages.PreparingtoinstallarchivesDownloadingAndroidSDKPlatform-tools,revision26.0.2Downloadinterrupted:Connectiontohttps://dl.google.comrefusedDone.Nothingwasinstalled.PreparingtoinstallarchivesDownloadingAndroidSDKPlatform-tools,revision26.0.2Downloadfinishedwithwrongch

如何使用Haskell读取文件中的n行?

我有一个形式的文件:3123457第一行是行的数量我知道:getInt::IOIntgetInt=readLnmain=donum阅读第一行。接下来,我尝试了:readInts::IO[Int]readInts=fmap(mapread.words)getLine要阅读一行并获取列表:[a,b]。我试图在递归循环中使用上面的loop::Int->IO()loopn=if1==nthendonum我只得到第一行:[5,3]但是我需要阅读其余的行,给定n看答案输入文件的格式看起来很像编程竞赛中使用的格式。这是我用于这样的编程比赛的标准设置:importControl.MonadimportText

android - Android上的Haskell解释器?

已结束。这个问题是off-topic.它目前不接受答案。想要改进这个问题?Updatethequestion所以它是on-topic堆栈溢出。关闭9年前。Improvethisquestion是否有可以在Android上安装的Haskell解释器(带有标准库)?以便拥有Android设备的人可以在Android设备上做一些Haskell练习:在Haskell中编写和运行一些示例代码。 最佳答案 Hugs是用C语言编写的,非常便携。应该可以移植到安卓。 关于android-Android上

android - Android上的Haskell解释器?

已结束。这个问题是off-topic.它目前不接受答案。想要改进这个问题?Updatethequestion所以它是on-topic堆栈溢出。关闭9年前。Improvethisquestion是否有可以在Android上安装的Haskell解释器(带有标准库)?以便拥有Android设备的人可以在Android设备上做一些Haskell练习:在Haskell中编写和运行一些示例代码。 最佳答案 Hugs是用C语言编写的,非常便携。应该可以移植到安卓。 关于android-Android上

android - ionic 构建错误 : You have not accepted the license agreements of the following SDK components: [Android SDK Platform 24]

我正在尝试运行命令ionicbuildandroid--release来构建apk,但我收到此错误Totaltime:1.767secsError:cmd:Commandfailedwithexitcode1Erroroutput:FAILURE:Buildfailedwithanexception.Whatwentwrong:Aproblemoccurredconfiguringrootproject'android'.YouhavenotacceptedthelicenseagreementsofthefollowingSDKcomponents:[AndroidSDKPlatfo

android - ionic 构建错误 : You have not accepted the license agreements of the following SDK components: [Android SDK Platform 24]

我正在尝试运行命令ionicbuildandroid--release来构建apk,但我收到此错误Totaltime:1.767secsError:cmd:Commandfailedwithexitcode1Erroroutput:FAILURE:Buildfailedwithanexception.Whatwentwrong:Aproblemoccurredconfiguringrootproject'android'.YouhavenotacceptedthelicenseagreementsofthefollowingSDKcomponents:[AndroidSDKPlatfo

memory - Haskell 堆栈溢出

我正在编写一个遗传算法来生成字符串“helloworld”。但是当n大于等于10,000时,evolve函数会产生堆栈溢出。moduleGeneticswhereimportData.List(sortBy)importRandom(randomRIO)importControl.Monad(foldM)classGenegwhere--Howidealisthegenefrom0.0to1.0?fitness::g->Float--Howdoesagenemutate?mutate::g->IOg--Howmanyspecieswillbeexplored?species::[g]-

memory - Haskell 堆栈溢出

我正在编写一个遗传算法来生成字符串“helloworld”。但是当n大于等于10,000时,evolve函数会产生堆栈溢出。moduleGeneticswhereimportData.List(sortBy)importRandom(randomRIO)importControl.Monad(foldM)classGenegwhere--Howidealisthegenefrom0.0to1.0?fitness::g->Float--Howdoesagenemutate?mutate::g->IOg--Howmanyspecieswillbeexplored?species::[g]-

haskell - 为什么这里的早期术语不被垃圾收集?

如果我定义KolakoskiSequence作为kolakoski::()->[Int]kolakoski()=1:2:helper()wherehelper()=2:concat(zipWithreplicate(helper())(cycle[1,2]))并找到第500,000,000项kolakoski()!!500000000我发现当使用ghc-O编译时,这会很快消耗大量内存。但是在关闭优化的情况下,它几乎没有使用任何东西。哪个优化导致了这个问题,我该如何关闭它? 最佳答案 让我们比较实际数字。如果在没有优化的情况下运行,您

haskell - 为什么这里的早期术语不被垃圾收集?

如果我定义KolakoskiSequence作为kolakoski::()->[Int]kolakoski()=1:2:helper()wherehelper()=2:concat(zipWithreplicate(helper())(cycle[1,2]))并找到第500,000,000项kolakoski()!!500000000我发现当使用ghc-O编译时,这会很快消耗大量内存。但是在关闭优化的情况下,它几乎没有使用任何东西。哪个优化导致了这个问题,我该如何关闭它? 最佳答案 让我们比较实际数字。如果在没有优化的情况下运行,您