From ben at well-typed.com Sun May 1 10:53:28 2016 From: ben at well-typed.com (Ben Gamari) Date: Sun, 01 May 2016 12:53:28 +0200 Subject: [Haskell-cafe] Call for Contributions - Haskell Communities and Activities Report, May 2016 edition (30th edition) In-Reply-To: References: Message-ID: <87wpne6od3.fsf@smart-cactus.org> Mihai Maruseac writes: > Dear all, > > It's that time of the year again (https://ro-che.info/ccc/16). :) > > We would like to collect contributions for the 30th edition of the > Hello Mihai, Here is GHC's contribution to the current HCAR. Let me know if you'd like me to make any revisions. Sorry for the late submission! Thanks again for your effort in organizing this. Cheers, - Ben -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 472 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hcar.tex Type: text/x-tex Size: 18608 bytes Desc: not available URL: From k-bx at k-bx.com Sun May 1 12:31:29 2016 From: k-bx at k-bx.com (Kostiantyn Rybnikov) Date: Sun, 1 May 2016 15:31:29 +0300 Subject: [Haskell-cafe] Hackage package upload error: Invalid package Message-ID: Hi! Wanted to upload the 0.8.1 version of hedis, did what I usually did, but getting an error. Running "stack -v upload ." seems to show some tls-related details. ``` ? hedis git:(master) stack -v upload . Version 1.0.4.3 x86_64 2016-05-01 15:29:31.034044: [debug] Checking for project config at: /Users/kb/workspace/hedis/stack.yaml @(stack_2rXRdr1j02iFXWAif5re4K:Stack.Config src/Stack/Config.hs:761:9) 2016-05-01 15:29:31.037100: [debug] Loading project config file stack.yaml @(stack_2rXRdr1j02iFXWAif5re4K:Stack.Config src/Stack/Config.hs:779:13) 2016-05-01 15:29:31.110561: [debug] Checking for project config at: /Users/kb/workspace/hedis/stack.yaml @(stack_2rXRdr1j02iFXWAif5re4K:Stack.Config src/Stack/Config.hs:761:9) 2016-05-01 15:29:31.110690: [debug] Loading project config file stack.yaml @(stack_2rXRdr1j02iFXWAif5re4K:Stack.Config src/Stack/Config.hs:779:13) 2016-05-01 15:29:31.111459: [debug] Trying to decode /Users/kb/.stack/build-plan-cache/x86_64-osx/lts-5.3.cache @(stack_2rXRdr1j02iFXWAif5re4K:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:55:5) 2016-05-01 15:29:31.124939: [debug] Success decoding /Users/kb/.stack/build-plan-cache/x86_64-osx/lts-5.3.cache @(stack_2rXRdr1j02iFXWAif5re4K:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:64:13) 2016-05-01 15:29:31.132890: [debug] Trying to decode /Users/kb/.stack/indices/Hackage/00-index.cache @(stack_2rXRdr1j02iFXWAif5re4K:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:55:5) 2016-05-01 15:29:31.421690: [debug] Success decoding /Users/kb/.stack/indices/Hackage/00-index.cache @(stack_2rXRdr1j02iFXWAif5re4K:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:64:13) 2016-05-01 15:29:31.434522: [debug] Run process: ghc --info @(stack_2rXRdr1j02iFXWAif5re4K:System.Process.Read src/System/Process/Read.hs:269:3) 2016-05-01 15:29:31.498337: [debug] Run process: ghc --numeric-version @(stack_2rXRdr1j02iFXWAif5re4K:System.Process.Read src/System/Process/Read.hs:269:3) 2016-05-01 15:29:31.543696: [debug] Run process: ghc-pkg --no-user-package-db field --simple-output Cabal version @(stack_2rXRdr1j02iFXWAif5re4K:System.Process.Read src/System/Process/Read.hs:269:3) 2016-05-01 15:29:31.576011: [debug] Run process: ghc-pkg --no-user-package-db list --global @(stack_2rXRdr1j02iFXWAif5re4K:System.Process.Read src/System/Process/Read.hs:269:3) 2016-05-01 15:29:31.625682: [info] Getting file list for /Users/kb/workspace/hedis/ @(stack_2rXRdr1j02iFXWAif5re4K:Stack.SDist src/Stack/SDist.hs:96:5) 2016-05-01 15:29:31.628599: [debug] Checking resolver: lts-5.3 @(stack_2rXRdr1j02iFXWAif5re4K:Stack.Build.Source src/Stack/Build/Source.hs:164:17) 2016-05-01 15:29:31.628777: [debug] Trying to decode /Users/kb/.stack/build-plan-cache/x86_64-osx/lts-5.3.cache @(stack_2rXRdr1j02iFXWAif5re4K:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:55:5) 2016-05-01 15:29:31.636259: [debug] Success decoding /Users/kb/.stack/build-plan-cache/x86_64-osx/lts-5.3.cache @(stack_2rXRdr1j02iFXWAif5re4K:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:64:13) 2016-05-01 15:29:31.650120: [debug] Run process: ghc-pkg --no-user-package-db list --global @(stack_2rXRdr1j02iFXWAif5re4K:System.Process.Read src/System/Process/Read.hs:269:3) 2016-05-01 15:29:31.679601: [debug] Run process: /Users/kb/.stack/setup-exe-cache/x86_64-osx/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.22.5.0 sdist --list-sources /private/var/folders/7l/3ys9j0lx20j6z69lm6s_9r780000gn/T/stack-sdist56408/source-files-list @(stack_2rXRdr1j02iFXWAif5re4K:System.Process.Read src/System/Process/Read.hs:287:3) 2016-05-01 15:29:31.728919: [info] Building sdist tarball for /Users/kb/workspace/hedis/ @(stack_2rXRdr1j02iFXWAif5re4K:Stack.SDist src/Stack/SDist.hs:98:5) 2016-05-01 15:29:31.756558: [info] Checking package 'hedis' for common mistakes @(stack_2rXRdr1j02iFXWAif5re4K:Stack.SDist src/Stack/SDist.hs:274:5) 2016-05-01 15:29:31.758110: [warn] Package check reported the following warnings: 'ghc-options: -Wall -Werror' makes the package very easy to break with future GHC versions because new GHC versions often add new warnings. Use just 'ghc-options: -Wall' instead. 'ghc-prof-options: -auto-all' is fine during development, but not recommended in a distributed package. @(stack_2rXRdr1j02iFXWAif5re4K:Stack.SDist src/Stack/SDist.hs:285:9) Uploading hedis-0.8.1.tar.gz... TlsExceptionHostPort (HandshakeFailed (Error_Packet_unexpected "Alert [(AlertLevel_Fatal,BadRecordMac)]" " expected: change cipher")) "hackage.haskell.org" 443 ? hedis git:(master) stack upload . Getting file list for /Users/kb/workspace/hedis/ Building sdist tarball for /Users/kb/workspace/hedis/ Checking package 'hedis' for common mistakes Package check reported the following warnings: 'ghc-options: -Wall -Werror' makes the package very easy to break with future GHC versions because new GHC versions often add new warnings. Use just 'ghc-options: -Wall' instead. 'ghc-prof-options: -auto-all' is fine during development, but not recommended in a distributed package. Uploading hedis-0.8.1.tar.gz... unhandled status code: 400 Error: Invalid package 'ghc-options: -Wall -Werror' makes the package very easy to break with future GHC versions because new GHC versions often add new warnings. Use just 'ghc-options: -Wall' instead. Upload failed on hedis-0.8.1.tar.gz ``` Hope somebody can take a look. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From michaelburge at pobox.com Sun May 1 12:37:10 2016 From: michaelburge at pobox.com (Michael Burge) Date: Sun, 1 May 2016 05:37:10 -0700 Subject: [Haskell-cafe] Hackage package upload error: Invalid package In-Reply-To: References: Message-ID: It gives you a warning at the end about the use of -Werror and -auto-all. If you remove those options, does it go through? On Sun, May 1, 2016 at 5:31 AM, Kostiantyn Rybnikov wrote: > Hi! > > Wanted to upload the 0.8.1 version of hedis, did what I usually did, but > getting an error. Running "stack -v upload ." seems to show some > tls-related details. > > ``` > ? hedis git:(master) stack -v upload . > Version 1.0.4.3 x86_64 > 2016-05-01 15:29:31.034044: [debug] Checking for project config at: > /Users/kb/workspace/hedis/stack.yaml > @(stack_2rXRdr1j02iFXWAif5re4K:Stack.Config src/Stack/Config.hs:761:9) > 2016-05-01 15:29:31.037100: [debug] Loading project config file stack.yaml > @(stack_2rXRdr1j02iFXWAif5re4K:Stack.Config src/Stack/Config.hs:779:13) > 2016-05-01 15:29:31.110561: [debug] Checking for project config at: > /Users/kb/workspace/hedis/stack.yaml > @(stack_2rXRdr1j02iFXWAif5re4K:Stack.Config src/Stack/Config.hs:761:9) > 2016-05-01 15:29:31.110690: [debug] Loading project config file stack.yaml > @(stack_2rXRdr1j02iFXWAif5re4K:Stack.Config src/Stack/Config.hs:779:13) > 2016-05-01 15:29:31.111459: [debug] Trying to decode > /Users/kb/.stack/build-plan-cache/x86_64-osx/lts-5.3.cache > @(stack_2rXRdr1j02iFXWAif5re4K:Data.Binary.VersionTagged > src/Data/Binary/VersionTagged.hs:55:5) > 2016-05-01 15:29:31.124939: [debug] Success decoding > /Users/kb/.stack/build-plan-cache/x86_64-osx/lts-5.3.cache > @(stack_2rXRdr1j02iFXWAif5re4K:Data.Binary.VersionTagged > src/Data/Binary/VersionTagged.hs:64:13) > 2016-05-01 15:29:31.132890: [debug] Trying to decode > /Users/kb/.stack/indices/Hackage/00-index.cache > @(stack_2rXRdr1j02iFXWAif5re4K:Data.Binary.VersionTagged > src/Data/Binary/VersionTagged.hs:55:5) > 2016-05-01 15:29:31.421690: [debug] Success decoding > /Users/kb/.stack/indices/Hackage/00-index.cache > @(stack_2rXRdr1j02iFXWAif5re4K:Data.Binary.VersionTagged > src/Data/Binary/VersionTagged.hs:64:13) > 2016-05-01 15:29:31.434522: [debug] Run process: ghc --info > @(stack_2rXRdr1j02iFXWAif5re4K:System.Process.Read > src/System/Process/Read.hs:269:3) > 2016-05-01 15:29:31.498337: [debug] Run process: ghc --numeric-version > @(stack_2rXRdr1j02iFXWAif5re4K:System.Process.Read > src/System/Process/Read.hs:269:3) > 2016-05-01 15:29:31.543696: [debug] Run process: ghc-pkg > --no-user-package-db field --simple-output Cabal version > @(stack_2rXRdr1j02iFXWAif5re4K:System.Process.Read > src/System/Process/Read.hs:269:3) > 2016-05-01 15:29:31.576011: [debug] Run process: ghc-pkg > --no-user-package-db list --global > @(stack_2rXRdr1j02iFXWAif5re4K:System.Process.Read > src/System/Process/Read.hs:269:3) > 2016-05-01 15:29:31.625682: [info] Getting file list for > /Users/kb/workspace/hedis/ @(stack_2rXRdr1j02iFXWAif5re4K:Stack.SDist > src/Stack/SDist.hs:96:5) > 2016-05-01 15:29:31.628599: [debug] Checking resolver: lts-5.3 > @(stack_2rXRdr1j02iFXWAif5re4K:Stack.Build.Source > src/Stack/Build/Source.hs:164:17) > 2016-05-01 15:29:31.628777: [debug] Trying to decode > /Users/kb/.stack/build-plan-cache/x86_64-osx/lts-5.3.cache > @(stack_2rXRdr1j02iFXWAif5re4K:Data.Binary.VersionTagged > src/Data/Binary/VersionTagged.hs:55:5) > 2016-05-01 15:29:31.636259: [debug] Success decoding > /Users/kb/.stack/build-plan-cache/x86_64-osx/lts-5.3.cache > @(stack_2rXRdr1j02iFXWAif5re4K:Data.Binary.VersionTagged > src/Data/Binary/VersionTagged.hs:64:13) > 2016-05-01 15:29:31.650120: [debug] Run process: ghc-pkg > --no-user-package-db list --global > @(stack_2rXRdr1j02iFXWAif5re4K:System.Process.Read > src/System/Process/Read.hs:269:3) > 2016-05-01 15:29:31.679601: [debug] Run process: > /Users/kb/.stack/setup-exe-cache/x86_64-osx/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3 > --builddir=.stack-work/dist/x86_64-osx/Cabal-1.22.5.0 sdist --list-sources > /private/var/folders/7l/3ys9j0lx20j6z69lm6s_9r780000gn/T/stack-sdist56408/source-files-list > @(stack_2rXRdr1j02iFXWAif5re4K:System.Process.Read > src/System/Process/Read.hs:287:3) > 2016-05-01 15:29:31.728919: [info] Building sdist tarball for > /Users/kb/workspace/hedis/ @(stack_2rXRdr1j02iFXWAif5re4K:Stack.SDist > src/Stack/SDist.hs:98:5) > 2016-05-01 15:29:31.756558: [info] Checking package 'hedis' for common > mistakes @(stack_2rXRdr1j02iFXWAif5re4K:Stack.SDist > src/Stack/SDist.hs:274:5) > 2016-05-01 15:29:31.758110: [warn] Package check reported the following > warnings: > 'ghc-options: -Wall -Werror' makes the package very easy to break with > future GHC versions because new GHC versions often add new warnings. Use > just 'ghc-options: -Wall' instead. > 'ghc-prof-options: -auto-all' is fine during development, but not > recommended in a distributed package. > @(stack_2rXRdr1j02iFXWAif5re4K:Stack.SDist src/Stack/SDist.hs:285:9) > Uploading hedis-0.8.1.tar.gz... TlsExceptionHostPort (HandshakeFailed > (Error_Packet_unexpected "Alert [(AlertLevel_Fatal,BadRecordMac)]" " > expected: change cipher")) "hackage.haskell.org" 443 > ? hedis git:(master) stack upload . > Getting file list for /Users/kb/workspace/hedis/ > Building sdist tarball for /Users/kb/workspace/hedis/ > Checking package 'hedis' for common mistakes > Package check reported the following warnings: > 'ghc-options: -Wall -Werror' makes the package very easy to break with > future GHC versions because new GHC versions often add new warnings. Use > just 'ghc-options: -Wall' instead. > 'ghc-prof-options: -auto-all' is fine during development, but not > recommended in a distributed package. > Uploading hedis-0.8.1.tar.gz... unhandled status code: 400 > Error: Invalid package > > 'ghc-options: -Wall -Werror' makes the package very easy to break with > future GHC versions because new GHC versions often add new warnings. Use > just 'ghc-options: -Wall' instead. > Upload failed on hedis-0.8.1.tar.gz > ``` > > Hope somebody can take a look. > Thank you. > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From michaelburge at pobox.com Sun May 1 12:50:49 2016 From: michaelburge at pobox.com (Michael Burge) Date: Sun, 1 May 2016 05:50:49 -0700 Subject: [Haskell-cafe] Hackage package upload error: Invalid package In-Reply-To: References: Message-ID: For the TLS error, try generating the hackage-compatible file manually and uploading through their web interface. If that succeeds, then you can then ask where along the path from stack to hackage it differs from the manual upload. If that fails, then I would test for packet corruption on your end next. On Sun, May 1, 2016 at 5:37 AM, Michael Burge wrote: > It gives you a warning at the end about the use of -Werror and -auto-all. > If you remove those options, does it go through? > > On Sun, May 1, 2016 at 5:31 AM, Kostiantyn Rybnikov wrote: > >> Hi! >> >> Wanted to upload the 0.8.1 version of hedis, did what I usually did, but >> getting an error. Running "stack -v upload ." seems to show some >> tls-related details. >> >> ``` >> ? hedis git:(master) stack -v upload . >> Version 1.0.4.3 x86_64 >> 2016-05-01 15:29:31.034044: [debug] Checking for project config at: >> /Users/kb/workspace/hedis/stack.yaml >> @(stack_2rXRdr1j02iFXWAif5re4K:Stack.Config src/Stack/Config.hs:761:9) >> 2016-05-01 15:29:31.037100: [debug] Loading project config file >> stack.yaml @(stack_2rXRdr1j02iFXWAif5re4K:Stack.Config >> src/Stack/Config.hs:779:13) >> 2016-05-01 15:29:31.110561: [debug] Checking for project config at: >> /Users/kb/workspace/hedis/stack.yaml >> @(stack_2rXRdr1j02iFXWAif5re4K:Stack.Config src/Stack/Config.hs:761:9) >> 2016-05-01 15:29:31.110690: [debug] Loading project config file >> stack.yaml @(stack_2rXRdr1j02iFXWAif5re4K:Stack.Config >> src/Stack/Config.hs:779:13) >> 2016-05-01 15:29:31.111459: [debug] Trying to decode >> /Users/kb/.stack/build-plan-cache/x86_64-osx/lts-5.3.cache >> @(stack_2rXRdr1j02iFXWAif5re4K:Data.Binary.VersionTagged >> src/Data/Binary/VersionTagged.hs:55:5) >> 2016-05-01 15:29:31.124939: [debug] Success decoding >> /Users/kb/.stack/build-plan-cache/x86_64-osx/lts-5.3.cache >> @(stack_2rXRdr1j02iFXWAif5re4K:Data.Binary.VersionTagged >> src/Data/Binary/VersionTagged.hs:64:13) >> 2016-05-01 15:29:31.132890: [debug] Trying to decode >> /Users/kb/.stack/indices/Hackage/00-index.cache >> @(stack_2rXRdr1j02iFXWAif5re4K:Data.Binary.VersionTagged >> src/Data/Binary/VersionTagged.hs:55:5) >> 2016-05-01 15:29:31.421690: [debug] Success decoding >> /Users/kb/.stack/indices/Hackage/00-index.cache >> @(stack_2rXRdr1j02iFXWAif5re4K:Data.Binary.VersionTagged >> src/Data/Binary/VersionTagged.hs:64:13) >> 2016-05-01 15:29:31.434522: [debug] Run process: ghc --info >> @(stack_2rXRdr1j02iFXWAif5re4K:System.Process.Read >> src/System/Process/Read.hs:269:3) >> 2016-05-01 15:29:31.498337: [debug] Run process: ghc --numeric-version >> @(stack_2rXRdr1j02iFXWAif5re4K:System.Process.Read >> src/System/Process/Read.hs:269:3) >> 2016-05-01 15:29:31.543696: [debug] Run process: ghc-pkg >> --no-user-package-db field --simple-output Cabal version >> @(stack_2rXRdr1j02iFXWAif5re4K:System.Process.Read >> src/System/Process/Read.hs:269:3) >> 2016-05-01 15:29:31.576011: [debug] Run process: ghc-pkg >> --no-user-package-db list --global >> @(stack_2rXRdr1j02iFXWAif5re4K:System.Process.Read >> src/System/Process/Read.hs:269:3) >> 2016-05-01 15:29:31.625682: [info] Getting file list for >> /Users/kb/workspace/hedis/ @(stack_2rXRdr1j02iFXWAif5re4K:Stack.SDist >> src/Stack/SDist.hs:96:5) >> 2016-05-01 15:29:31.628599: [debug] Checking resolver: lts-5.3 >> @(stack_2rXRdr1j02iFXWAif5re4K:Stack.Build.Source >> src/Stack/Build/Source.hs:164:17) >> 2016-05-01 15:29:31.628777: [debug] Trying to decode >> /Users/kb/.stack/build-plan-cache/x86_64-osx/lts-5.3.cache >> @(stack_2rXRdr1j02iFXWAif5re4K:Data.Binary.VersionTagged >> src/Data/Binary/VersionTagged.hs:55:5) >> 2016-05-01 15:29:31.636259: [debug] Success decoding >> /Users/kb/.stack/build-plan-cache/x86_64-osx/lts-5.3.cache >> @(stack_2rXRdr1j02iFXWAif5re4K:Data.Binary.VersionTagged >> src/Data/Binary/VersionTagged.hs:64:13) >> 2016-05-01 15:29:31.650120: [debug] Run process: ghc-pkg >> --no-user-package-db list --global >> @(stack_2rXRdr1j02iFXWAif5re4K:System.Process.Read >> src/System/Process/Read.hs:269:3) >> 2016-05-01 15:29:31.679601: [debug] Run process: >> /Users/kb/.stack/setup-exe-cache/x86_64-osx/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3 >> --builddir=.stack-work/dist/x86_64-osx/Cabal-1.22.5.0 sdist --list-sources >> /private/var/folders/7l/3ys9j0lx20j6z69lm6s_9r780000gn/T/stack-sdist56408/source-files-list >> @(stack_2rXRdr1j02iFXWAif5re4K:System.Process.Read >> src/System/Process/Read.hs:287:3) >> 2016-05-01 15:29:31.728919: [info] Building sdist tarball for >> /Users/kb/workspace/hedis/ @(stack_2rXRdr1j02iFXWAif5re4K:Stack.SDist >> src/Stack/SDist.hs:98:5) >> 2016-05-01 15:29:31.756558: [info] Checking package 'hedis' for common >> mistakes @(stack_2rXRdr1j02iFXWAif5re4K:Stack.SDist >> src/Stack/SDist.hs:274:5) >> 2016-05-01 15:29:31.758110: [warn] Package check reported the following >> warnings: >> 'ghc-options: -Wall -Werror' makes the package very easy to break with >> future GHC versions because new GHC versions often add new warnings. Use >> just 'ghc-options: -Wall' instead. >> 'ghc-prof-options: -auto-all' is fine during development, but not >> recommended in a distributed package. >> @(stack_2rXRdr1j02iFXWAif5re4K:Stack.SDist src/Stack/SDist.hs:285:9) >> Uploading hedis-0.8.1.tar.gz... TlsExceptionHostPort (HandshakeFailed >> (Error_Packet_unexpected "Alert [(AlertLevel_Fatal,BadRecordMac)]" " >> expected: change cipher")) "hackage.haskell.org" 443 >> ? hedis git:(master) stack upload . >> Getting file list for /Users/kb/workspace/hedis/ >> Building sdist tarball for /Users/kb/workspace/hedis/ >> Checking package 'hedis' for common mistakes >> Package check reported the following warnings: >> 'ghc-options: -Wall -Werror' makes the package very easy to break with >> future GHC versions because new GHC versions often add new warnings. Use >> just 'ghc-options: -Wall' instead. >> 'ghc-prof-options: -auto-all' is fine during development, but not >> recommended in a distributed package. >> Uploading hedis-0.8.1.tar.gz... unhandled status code: 400 >> Error: Invalid package >> >> 'ghc-options: -Wall -Werror' makes the package very easy to break with >> future GHC versions because new GHC versions often add new warnings. Use >> just 'ghc-options: -Wall' instead. >> Upload failed on hedis-0.8.1.tar.gz >> ``` >> >> Hope somebody can take a look. >> Thank you. >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From k-bx at k-bx.com Sun May 1 12:59:38 2016 From: k-bx at k-bx.com (Kostiantyn Rybnikov) Date: Sun, 1 May 2016 15:59:38 +0300 Subject: [Haskell-cafe] Hackage package upload error: Invalid package In-Reply-To: References: Message-ID: Both -Werror and -auto-all should be hidden behind a "-dev" flag, so the warning is not really valid if I'm not mistaken. Plus, it had been there for a while now and worked before. Update regarding a tls error: it seems it doesn't happen now, the log is like this: ``` ? hedis git:(master) stack upload -v . Version 1.0.4.3, Git revision db1afb275ebd64016e8ef0db122f0f03da9e5906 (3242 commits) x86_64 2016-05-01 15:59:16.723295: [debug] Checking for project config at: /home/kb/workspace/hedis/stack.yaml @(stack_JlzIf2rBNeuFEjNaHJwIZR:Stack.Config src/Stack/Config.hs:761:9) 2016-05-01 15:59:16.723597: [debug] Loading project config file stack.yaml @(stack_JlzIf2rBNeuFEjNaHJwIZR:Stack.Config src/Stack/Config.hs:779:13) 2016-05-01 15:59:16.761440: [debug] Checking for project config at: /home/kb/workspace/hedis/stack.yaml @(stack_JlzIf2rBNeuFEjNaHJwIZR:Stack.Config src/Stack/Config.hs:761:9) 2016-05-01 15:59:16.761726: [debug] Loading project config file stack.yaml @(stack_JlzIf2rBNeuFEjNaHJwIZR:Stack.Config src/Stack/Config.hs:779:13) 2016-05-01 15:59:16.764059: [debug] Run process: ldd /usr/bin/stack @(stack_JlzIf2rBNeuFEjNaHJwIZR:System.Process.Read src/System/Process/Read.hs:269:3) 2016-05-01 15:59:16.778551: [debug] Trying to decode /home/kb/.stack/build-plan-cache/x86_64-linux/lts-5.3.cache @(stack_JlzIf2rBNeuFEjNaHJwIZR:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:55:5) 2016-05-01 15:59:16.800503: [debug] Success decoding /home/kb/.stack/build-plan-cache/x86_64-linux/lts-5.3.cache @(stack_JlzIf2rBNeuFEjNaHJwIZR:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:64:13) 2016-05-01 15:59:16.800841: [debug] Trying to decode /home/kb/.stack/indices/Hackage/00-index.cache @(stack_JlzIf2rBNeuFEjNaHJwIZR:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:55:5) 2016-05-01 15:59:17.180117: [debug] Success decoding /home/kb/.stack/indices/Hackage/00-index.cache @(stack_JlzIf2rBNeuFEjNaHJwIZR:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:64:13) 2016-05-01 15:59:17.206082: [debug] Run process: ghc --info @(stack_JlzIf2rBNeuFEjNaHJwIZR:System.Process.Read src/System/Process/Read.hs:269:3) 2016-05-01 15:59:17.274505: [debug] Run process: ghc --numeric-version @(stack_JlzIf2rBNeuFEjNaHJwIZR:System.Process.Read src/System/Process/Read.hs:269:3) 2016-05-01 15:59:17.320953: [debug] Run process: ghc-pkg --no-user-package-db field --simple-output Cabal version @(stack_JlzIf2rBNeuFEjNaHJwIZR:System.Process.Read src/System/Process/Read.hs:269:3) 2016-05-01 15:59:17.349951: [debug] Run process: ghc-pkg --no-user-package-db list --global @(stack_JlzIf2rBNeuFEjNaHJwIZR:System.Process.Read src/System/Process/Read.hs:269:3) 2016-05-01 15:59:17.384645: [info] Getting file list for /home/kb/workspace/hedis/ @(stack_JlzIf2rBNeuFEjNaHJwIZR:Stack.SDist src/Stack/SDist.hs:96:5) 2016-05-01 15:59:17.388361: [debug] Checking resolver: lts-5.3 @(stack_JlzIf2rBNeuFEjNaHJwIZR:Stack.Build.Source src/Stack/Build/Source.hs:164:17) 2016-05-01 15:59:17.388599: [debug] Trying to decode /home/kb/.stack/build-plan-cache/x86_64-linux/lts-5.3.cache @(stack_JlzIf2rBNeuFEjNaHJwIZR:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:55:5) 2016-05-01 15:59:17.407773: [debug] Success decoding /home/kb/.stack/build-plan-cache/x86_64-linux/lts-5.3.cache @(stack_JlzIf2rBNeuFEjNaHJwIZR:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:64:13) 2016-05-01 15:59:17.438372: [debug] Run process: ghc-pkg --no-user-package-db list --global @(stack_JlzIf2rBNeuFEjNaHJwIZR:System.Process.Read src/System/Process/Read.hs:269:3) 2016-05-01 15:59:17.470217: [debug] Run process: /home/kb/.stack/setup-exe-cache/x86_64-linux/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3 --builddir=.stack-work/dist/x86_64-linux/Cabal-1.22.5.0 sdist --list-sources /tmp/stack-sdist11498/source-files-list @(stack_JlzIf2rBNeuFEjNaHJwIZR:System.Process.Read src/System/Process/Read.hs:287:3) 2016-05-01 15:59:17.523577: [info] Building sdist tarball for /home/kb/workspace/hedis/ @(stack_JlzIf2rBNeuFEjNaHJwIZR:Stack.SDist src/Stack/SDist.hs:98:5) 2016-05-01 15:59:17.565851: [info] Checking package 'hedis' for common mistakes @(stack_JlzIf2rBNeuFEjNaHJwIZR:Stack.SDist src/Stack/SDist.hs:274:5) 2016-05-01 15:59:17.566205: [warn] Package check reported the following warnings: 'ghc-options: -Wall -Werror' makes the package very easy to break with future GHC versions because new GHC versions often add new warnings. Use just 'ghc-options: -Wall' instead. 'ghc-prof-options: -auto-all' is fine during development, but not recommended in a distributed package. @(stack_JlzIf2rBNeuFEjNaHJwIZR:Stack.SDist src/Stack/SDist.hs:285:9) Uploading hedis-0.8.1.tar.gz... unhandled status code: 400 Error: Invalid package 'ghc-options: -Wall -Werror' makes the package very easy to break with future GHC versions because new GHC versions often add new warnings. Use just 'ghc-options: -Wall' instead. Upload failed on hedis-0.8.1.tar.gz ``` So, just status 400 somewhere. On Sun, May 1, 2016 at 3:50 PM, Michael Burge wrote: > For the TLS error, try generating the hackage-compatible file manually and > uploading through their web interface. If that succeeds, then you can then > ask where along the path from stack to hackage it differs from the manual > upload. If that fails, then I would test for packet corruption on your end > next. > > On Sun, May 1, 2016 at 5:37 AM, Michael Burge > wrote: > >> It gives you a warning at the end about the use of -Werror and -auto-all. >> If you remove those options, does it go through? >> >> On Sun, May 1, 2016 at 5:31 AM, Kostiantyn Rybnikov >> wrote: >> >>> Hi! >>> >>> Wanted to upload the 0.8.1 version of hedis, did what I usually did, but >>> getting an error. Running "stack -v upload ." seems to show some >>> tls-related details. >>> >>> ``` >>> ? hedis git:(master) stack -v upload . >>> Version 1.0.4.3 x86_64 >>> 2016-05-01 15:29:31.034044: [debug] Checking for project config at: >>> /Users/kb/workspace/hedis/stack.yaml >>> @(stack_2rXRdr1j02iFXWAif5re4K:Stack.Config src/Stack/Config.hs:761:9) >>> 2016-05-01 15:29:31.037100: [debug] Loading project config file >>> stack.yaml @(stack_2rXRdr1j02iFXWAif5re4K:Stack.Config >>> src/Stack/Config.hs:779:13) >>> 2016-05-01 15:29:31.110561: [debug] Checking for project config at: >>> /Users/kb/workspace/hedis/stack.yaml >>> @(stack_2rXRdr1j02iFXWAif5re4K:Stack.Config src/Stack/Config.hs:761:9) >>> 2016-05-01 15:29:31.110690: [debug] Loading project config file >>> stack.yaml @(stack_2rXRdr1j02iFXWAif5re4K:Stack.Config >>> src/Stack/Config.hs:779:13) >>> 2016-05-01 15:29:31.111459: [debug] Trying to decode >>> /Users/kb/.stack/build-plan-cache/x86_64-osx/lts-5.3.cache >>> @(stack_2rXRdr1j02iFXWAif5re4K:Data.Binary.VersionTagged >>> src/Data/Binary/VersionTagged.hs:55:5) >>> 2016-05-01 15:29:31.124939: [debug] Success decoding >>> /Users/kb/.stack/build-plan-cache/x86_64-osx/lts-5.3.cache >>> @(stack_2rXRdr1j02iFXWAif5re4K:Data.Binary.VersionTagged >>> src/Data/Binary/VersionTagged.hs:64:13) >>> 2016-05-01 15:29:31.132890: [debug] Trying to decode >>> /Users/kb/.stack/indices/Hackage/00-index.cache >>> @(stack_2rXRdr1j02iFXWAif5re4K:Data.Binary.VersionTagged >>> src/Data/Binary/VersionTagged.hs:55:5) >>> 2016-05-01 15:29:31.421690: [debug] Success decoding >>> /Users/kb/.stack/indices/Hackage/00-index.cache >>> @(stack_2rXRdr1j02iFXWAif5re4K:Data.Binary.VersionTagged >>> src/Data/Binary/VersionTagged.hs:64:13) >>> 2016-05-01 15:29:31.434522: [debug] Run process: ghc --info >>> @(stack_2rXRdr1j02iFXWAif5re4K:System.Process.Read >>> src/System/Process/Read.hs:269:3) >>> 2016-05-01 15:29:31.498337: [debug] Run process: ghc --numeric-version >>> @(stack_2rXRdr1j02iFXWAif5re4K:System.Process.Read >>> src/System/Process/Read.hs:269:3) >>> 2016-05-01 15:29:31.543696: [debug] Run process: ghc-pkg >>> --no-user-package-db field --simple-output Cabal version >>> @(stack_2rXRdr1j02iFXWAif5re4K:System.Process.Read >>> src/System/Process/Read.hs:269:3) >>> 2016-05-01 15:29:31.576011: [debug] Run process: ghc-pkg >>> --no-user-package-db list --global >>> @(stack_2rXRdr1j02iFXWAif5re4K:System.Process.Read >>> src/System/Process/Read.hs:269:3) >>> 2016-05-01 15:29:31.625682: [info] Getting file list for >>> /Users/kb/workspace/hedis/ @(stack_2rXRdr1j02iFXWAif5re4K:Stack.SDist >>> src/Stack/SDist.hs:96:5) >>> 2016-05-01 15:29:31.628599: [debug] Checking resolver: lts-5.3 >>> @(stack_2rXRdr1j02iFXWAif5re4K:Stack.Build.Source >>> src/Stack/Build/Source.hs:164:17) >>> 2016-05-01 15:29:31.628777: [debug] Trying to decode >>> /Users/kb/.stack/build-plan-cache/x86_64-osx/lts-5.3.cache >>> @(stack_2rXRdr1j02iFXWAif5re4K:Data.Binary.VersionTagged >>> src/Data/Binary/VersionTagged.hs:55:5) >>> 2016-05-01 15:29:31.636259: [debug] Success decoding >>> /Users/kb/.stack/build-plan-cache/x86_64-osx/lts-5.3.cache >>> @(stack_2rXRdr1j02iFXWAif5re4K:Data.Binary.VersionTagged >>> src/Data/Binary/VersionTagged.hs:64:13) >>> 2016-05-01 15:29:31.650120: [debug] Run process: ghc-pkg >>> --no-user-package-db list --global >>> @(stack_2rXRdr1j02iFXWAif5re4K:System.Process.Read >>> src/System/Process/Read.hs:269:3) >>> 2016-05-01 15:29:31.679601: [debug] Run process: >>> /Users/kb/.stack/setup-exe-cache/x86_64-osx/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3 >>> --builddir=.stack-work/dist/x86_64-osx/Cabal-1.22.5.0 sdist --list-sources >>> /private/var/folders/7l/3ys9j0lx20j6z69lm6s_9r780000gn/T/stack-sdist56408/source-files-list >>> @(stack_2rXRdr1j02iFXWAif5re4K:System.Process.Read >>> src/System/Process/Read.hs:287:3) >>> 2016-05-01 15:29:31.728919: [info] Building sdist tarball for >>> /Users/kb/workspace/hedis/ @(stack_2rXRdr1j02iFXWAif5re4K:Stack.SDist >>> src/Stack/SDist.hs:98:5) >>> 2016-05-01 15:29:31.756558: [info] Checking package 'hedis' for common >>> mistakes @(stack_2rXRdr1j02iFXWAif5re4K:Stack.SDist >>> src/Stack/SDist.hs:274:5) >>> 2016-05-01 15:29:31.758110: [warn] Package check reported the following >>> warnings: >>> 'ghc-options: -Wall -Werror' makes the package very easy to break with >>> future GHC versions because new GHC versions often add new warnings. Use >>> just 'ghc-options: -Wall' instead. >>> 'ghc-prof-options: -auto-all' is fine during development, but not >>> recommended in a distributed package. >>> @(stack_2rXRdr1j02iFXWAif5re4K:Stack.SDist src/Stack/SDist.hs:285:9) >>> Uploading hedis-0.8.1.tar.gz... TlsExceptionHostPort (HandshakeFailed >>> (Error_Packet_unexpected "Alert [(AlertLevel_Fatal,BadRecordMac)]" " >>> expected: change cipher")) "hackage.haskell.org" 443 >>> ? hedis git:(master) stack upload . >>> Getting file list for /Users/kb/workspace/hedis/ >>> Building sdist tarball for /Users/kb/workspace/hedis/ >>> Checking package 'hedis' for common mistakes >>> Package check reported the following warnings: >>> 'ghc-options: -Wall -Werror' makes the package very easy to break with >>> future GHC versions because new GHC versions often add new warnings. Use >>> just 'ghc-options: -Wall' instead. >>> 'ghc-prof-options: -auto-all' is fine during development, but not >>> recommended in a distributed package. >>> Uploading hedis-0.8.1.tar.gz... unhandled status code: 400 >>> Error: Invalid package >>> >>> 'ghc-options: -Wall -Werror' makes the package very easy to break with >>> future GHC versions because new GHC versions often add new warnings. Use >>> just 'ghc-options: -Wall' instead. >>> Upload failed on hedis-0.8.1.tar.gz >>> ``` >>> >>> Hope somebody can take a look. >>> Thank you. >>> >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adam at bergmark.nl Sun May 1 14:21:49 2016 From: adam at bergmark.nl (Adam Bergmark) Date: Sun, 1 May 2016 16:21:49 +0200 Subject: [Haskell-cafe] Hackage package upload error: Invalid package In-Reply-To: References: Message-ID: https://github.com/haskell/hackage-server/issues/360#issuecomment-215801249 On Sun, May 1, 2016 at 2:59 PM, Kostiantyn Rybnikov wrote: > Both -Werror and -auto-all should be hidden behind a "-dev" flag, so the > warning is not really valid if I'm not mistaken. Plus, it had been there > for a while now and worked before. > > Update regarding a tls error: it seems it doesn't happen now, the log is > like this: > > ``` > ? hedis git:(master) stack upload -v . > Version 1.0.4.3, Git revision db1afb275ebd64016e8ef0db122f0f03da9e5906 > (3242 commits) x86_64 > 2016-05-01 15:59:16.723295: [debug] Checking for project config at: > /home/kb/workspace/hedis/stack.yaml > @(stack_JlzIf2rBNeuFEjNaHJwIZR:Stack.Config src/Stack/Config.hs:761:9) > 2016-05-01 15:59:16.723597: [debug] Loading project config file stack.yaml > @(stack_JlzIf2rBNeuFEjNaHJwIZR:Stack.Config src/Stack/Config.hs:779:13) > 2016-05-01 15:59:16.761440: [debug] Checking for project config at: > /home/kb/workspace/hedis/stack.yaml > @(stack_JlzIf2rBNeuFEjNaHJwIZR:Stack.Config src/Stack/Config.hs:761:9) > 2016-05-01 15:59:16.761726: [debug] Loading project config file stack.yaml > @(stack_JlzIf2rBNeuFEjNaHJwIZR:Stack.Config src/Stack/Config.hs:779:13) > 2016-05-01 15:59:16.764059: [debug] Run process: ldd /usr/bin/stack > @(stack_JlzIf2rBNeuFEjNaHJwIZR:System.Process.Read > src/System/Process/Read.hs:269:3) > 2016-05-01 15:59:16.778551: [debug] Trying to decode > /home/kb/.stack/build-plan-cache/x86_64-linux/lts-5.3.cache > @(stack_JlzIf2rBNeuFEjNaHJwIZR:Data.Binary.VersionTagged > src/Data/Binary/VersionTagged.hs:55:5) > 2016-05-01 15:59:16.800503: [debug] Success decoding > /home/kb/.stack/build-plan-cache/x86_64-linux/lts-5.3.cache > @(stack_JlzIf2rBNeuFEjNaHJwIZR:Data.Binary.VersionTagged > src/Data/Binary/VersionTagged.hs:64:13) > 2016-05-01 15:59:16.800841: [debug] Trying to decode > /home/kb/.stack/indices/Hackage/00-index.cache > @(stack_JlzIf2rBNeuFEjNaHJwIZR:Data.Binary.VersionTagged > src/Data/Binary/VersionTagged.hs:55:5) > 2016-05-01 15:59:17.180117: [debug] Success decoding > /home/kb/.stack/indices/Hackage/00-index.cache > @(stack_JlzIf2rBNeuFEjNaHJwIZR:Data.Binary.VersionTagged > src/Data/Binary/VersionTagged.hs:64:13) > 2016-05-01 15:59:17.206082: [debug] Run process: ghc --info > @(stack_JlzIf2rBNeuFEjNaHJwIZR:System.Process.Read > src/System/Process/Read.hs:269:3) > 2016-05-01 15:59:17.274505: [debug] Run process: ghc --numeric-version > @(stack_JlzIf2rBNeuFEjNaHJwIZR:System.Process.Read > src/System/Process/Read.hs:269:3) > 2016-05-01 15:59:17.320953: [debug] Run process: ghc-pkg > --no-user-package-db field --simple-output Cabal version > @(stack_JlzIf2rBNeuFEjNaHJwIZR:System.Process.Read > src/System/Process/Read.hs:269:3) > 2016-05-01 15:59:17.349951: [debug] Run process: ghc-pkg > --no-user-package-db list --global > @(stack_JlzIf2rBNeuFEjNaHJwIZR:System.Process.Read > src/System/Process/Read.hs:269:3) > 2016-05-01 15:59:17.384645: [info] Getting file list for > /home/kb/workspace/hedis/ @(stack_JlzIf2rBNeuFEjNaHJwIZR:Stack.SDist > src/Stack/SDist.hs:96:5) > 2016-05-01 15:59:17.388361: [debug] Checking resolver: lts-5.3 > @(stack_JlzIf2rBNeuFEjNaHJwIZR:Stack.Build.Source > src/Stack/Build/Source.hs:164:17) > 2016-05-01 15:59:17.388599: [debug] Trying to decode > /home/kb/.stack/build-plan-cache/x86_64-linux/lts-5.3.cache > @(stack_JlzIf2rBNeuFEjNaHJwIZR:Data.Binary.VersionTagged > src/Data/Binary/VersionTagged.hs:55:5) > 2016-05-01 15:59:17.407773: [debug] Success decoding > /home/kb/.stack/build-plan-cache/x86_64-linux/lts-5.3.cache > @(stack_JlzIf2rBNeuFEjNaHJwIZR:Data.Binary.VersionTagged > src/Data/Binary/VersionTagged.hs:64:13) > 2016-05-01 15:59:17.438372: [debug] Run process: ghc-pkg > --no-user-package-db list --global > @(stack_JlzIf2rBNeuFEjNaHJwIZR:System.Process.Read > src/System/Process/Read.hs:269:3) > 2016-05-01 15:59:17.470217: [debug] Run process: > /home/kb/.stack/setup-exe-cache/x86_64-linux/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3 > --builddir=.stack-work/dist/x86_64-linux/Cabal-1.22.5.0 sdist > --list-sources /tmp/stack-sdist11498/source-files-list > @(stack_JlzIf2rBNeuFEjNaHJwIZR:System.Process.Read > src/System/Process/Read.hs:287:3) > 2016-05-01 15:59:17.523577: [info] Building sdist tarball for > /home/kb/workspace/hedis/ @(stack_JlzIf2rBNeuFEjNaHJwIZR:Stack.SDist > src/Stack/SDist.hs:98:5) > 2016-05-01 15:59:17.565851: [info] Checking package 'hedis' for common > mistakes @(stack_JlzIf2rBNeuFEjNaHJwIZR:Stack.SDist > src/Stack/SDist.hs:274:5) > 2016-05-01 15:59:17.566205: [warn] Package check reported the following > warnings: > 'ghc-options: -Wall -Werror' makes the package very easy to break with > future GHC versions because new GHC versions often add new warnings. Use > just 'ghc-options: -Wall' instead. > 'ghc-prof-options: -auto-all' is fine during development, but not > recommended in a distributed package. > @(stack_JlzIf2rBNeuFEjNaHJwIZR:Stack.SDist src/Stack/SDist.hs:285:9) > Uploading hedis-0.8.1.tar.gz... unhandled status code: 400 > Error: Invalid package > > 'ghc-options: -Wall -Werror' makes the package very easy to break with > future GHC versions because new GHC versions often add new warnings. Use > just 'ghc-options: -Wall' instead. > Upload failed on hedis-0.8.1.tar.gz > ``` > > So, just status 400 somewhere. > > On Sun, May 1, 2016 at 3:50 PM, Michael Burge > wrote: > >> For the TLS error, try generating the hackage-compatible file manually >> and uploading through their web interface. If that succeeds, then you can >> then ask where along the path from stack to hackage it differs from the >> manual upload. If that fails, then I would test for packet corruption on >> your end next. >> >> On Sun, May 1, 2016 at 5:37 AM, Michael Burge >> wrote: >> >>> It gives you a warning at the end about the use of -Werror and >>> -auto-all. If you remove those options, does it go through? >>> >>> On Sun, May 1, 2016 at 5:31 AM, Kostiantyn Rybnikov >>> wrote: >>> >>>> Hi! >>>> >>>> Wanted to upload the 0.8.1 version of hedis, did what I usually did, >>>> but getting an error. Running "stack -v upload ." seems to show some >>>> tls-related details. >>>> >>>> ``` >>>> ? hedis git:(master) stack -v upload . >>>> Version 1.0.4.3 x86_64 >>>> 2016-05-01 15:29:31.034044: [debug] Checking for project config at: >>>> /Users/kb/workspace/hedis/stack.yaml >>>> @(stack_2rXRdr1j02iFXWAif5re4K:Stack.Config src/Stack/Config.hs:761:9) >>>> 2016-05-01 15:29:31.037100: [debug] Loading project config file >>>> stack.yaml @(stack_2rXRdr1j02iFXWAif5re4K:Stack.Config >>>> src/Stack/Config.hs:779:13) >>>> 2016-05-01 15:29:31.110561: [debug] Checking for project config at: >>>> /Users/kb/workspace/hedis/stack.yaml >>>> @(stack_2rXRdr1j02iFXWAif5re4K:Stack.Config src/Stack/Config.hs:761:9) >>>> 2016-05-01 15:29:31.110690: [debug] Loading project config file >>>> stack.yaml @(stack_2rXRdr1j02iFXWAif5re4K:Stack.Config >>>> src/Stack/Config.hs:779:13) >>>> 2016-05-01 15:29:31.111459: [debug] Trying to decode >>>> /Users/kb/.stack/build-plan-cache/x86_64-osx/lts-5.3.cache >>>> @(stack_2rXRdr1j02iFXWAif5re4K:Data.Binary.VersionTagged >>>> src/Data/Binary/VersionTagged.hs:55:5) >>>> 2016-05-01 15:29:31.124939: [debug] Success decoding >>>> /Users/kb/.stack/build-plan-cache/x86_64-osx/lts-5.3.cache >>>> @(stack_2rXRdr1j02iFXWAif5re4K:Data.Binary.VersionTagged >>>> src/Data/Binary/VersionTagged.hs:64:13) >>>> 2016-05-01 15:29:31.132890: [debug] Trying to decode >>>> /Users/kb/.stack/indices/Hackage/00-index.cache >>>> @(stack_2rXRdr1j02iFXWAif5re4K:Data.Binary.VersionTagged >>>> src/Data/Binary/VersionTagged.hs:55:5) >>>> 2016-05-01 15:29:31.421690: [debug] Success decoding >>>> /Users/kb/.stack/indices/Hackage/00-index.cache >>>> @(stack_2rXRdr1j02iFXWAif5re4K:Data.Binary.VersionTagged >>>> src/Data/Binary/VersionTagged.hs:64:13) >>>> 2016-05-01 15:29:31.434522: [debug] Run process: ghc --info >>>> @(stack_2rXRdr1j02iFXWAif5re4K:System.Process.Read >>>> src/System/Process/Read.hs:269:3) >>>> 2016-05-01 15:29:31.498337: [debug] Run process: ghc --numeric-version >>>> @(stack_2rXRdr1j02iFXWAif5re4K:System.Process.Read >>>> src/System/Process/Read.hs:269:3) >>>> 2016-05-01 15:29:31.543696: [debug] Run process: ghc-pkg >>>> --no-user-package-db field --simple-output Cabal version >>>> @(stack_2rXRdr1j02iFXWAif5re4K:System.Process.Read >>>> src/System/Process/Read.hs:269:3) >>>> 2016-05-01 15:29:31.576011: [debug] Run process: ghc-pkg >>>> --no-user-package-db list --global >>>> @(stack_2rXRdr1j02iFXWAif5re4K:System.Process.Read >>>> src/System/Process/Read.hs:269:3) >>>> 2016-05-01 15:29:31.625682: [info] Getting file list for >>>> /Users/kb/workspace/hedis/ @(stack_2rXRdr1j02iFXWAif5re4K:Stack.SDist >>>> src/Stack/SDist.hs:96:5) >>>> 2016-05-01 15:29:31.628599: [debug] Checking resolver: lts-5.3 >>>> @(stack_2rXRdr1j02iFXWAif5re4K:Stack.Build.Source >>>> src/Stack/Build/Source.hs:164:17) >>>> 2016-05-01 15:29:31.628777: [debug] Trying to decode >>>> /Users/kb/.stack/build-plan-cache/x86_64-osx/lts-5.3.cache >>>> @(stack_2rXRdr1j02iFXWAif5re4K:Data.Binary.VersionTagged >>>> src/Data/Binary/VersionTagged.hs:55:5) >>>> 2016-05-01 15:29:31.636259: [debug] Success decoding >>>> /Users/kb/.stack/build-plan-cache/x86_64-osx/lts-5.3.cache >>>> @(stack_2rXRdr1j02iFXWAif5re4K:Data.Binary.VersionTagged >>>> src/Data/Binary/VersionTagged.hs:64:13) >>>> 2016-05-01 15:29:31.650120: [debug] Run process: ghc-pkg >>>> --no-user-package-db list --global >>>> @(stack_2rXRdr1j02iFXWAif5re4K:System.Process.Read >>>> src/System/Process/Read.hs:269:3) >>>> 2016-05-01 15:29:31.679601: [debug] Run process: >>>> /Users/kb/.stack/setup-exe-cache/x86_64-osx/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3 >>>> --builddir=.stack-work/dist/x86_64-osx/Cabal-1.22.5.0 sdist --list-sources >>>> /private/var/folders/7l/3ys9j0lx20j6z69lm6s_9r780000gn/T/stack-sdist56408/source-files-list >>>> @(stack_2rXRdr1j02iFXWAif5re4K:System.Process.Read >>>> src/System/Process/Read.hs:287:3) >>>> 2016-05-01 15:29:31.728919: [info] Building sdist tarball for >>>> /Users/kb/workspace/hedis/ @(stack_2rXRdr1j02iFXWAif5re4K:Stack.SDist >>>> src/Stack/SDist.hs:98:5) >>>> 2016-05-01 15:29:31.756558: [info] Checking package 'hedis' for common >>>> mistakes @(stack_2rXRdr1j02iFXWAif5re4K:Stack.SDist >>>> src/Stack/SDist.hs:274:5) >>>> 2016-05-01 15:29:31.758110: [warn] Package check reported the following >>>> warnings: >>>> 'ghc-options: -Wall -Werror' makes the package very easy to break with >>>> future GHC versions because new GHC versions often add new warnings. Use >>>> just 'ghc-options: -Wall' instead. >>>> 'ghc-prof-options: -auto-all' is fine during development, but not >>>> recommended in a distributed package. >>>> @(stack_2rXRdr1j02iFXWAif5re4K:Stack.SDist src/Stack/SDist.hs:285:9) >>>> Uploading hedis-0.8.1.tar.gz... TlsExceptionHostPort (HandshakeFailed >>>> (Error_Packet_unexpected "Alert [(AlertLevel_Fatal,BadRecordMac)]" " >>>> expected: change cipher")) "hackage.haskell.org" 443 >>>> ? hedis git:(master) stack upload . >>>> Getting file list for /Users/kb/workspace/hedis/ >>>> Building sdist tarball for /Users/kb/workspace/hedis/ >>>> Checking package 'hedis' for common mistakes >>>> Package check reported the following warnings: >>>> 'ghc-options: -Wall -Werror' makes the package very easy to break with >>>> future GHC versions because new GHC versions often add new warnings. Use >>>> just 'ghc-options: -Wall' instead. >>>> 'ghc-prof-options: -auto-all' is fine during development, but not >>>> recommended in a distributed package. >>>> Uploading hedis-0.8.1.tar.gz... unhandled status code: 400 >>>> Error: Invalid package >>>> >>>> 'ghc-options: -Wall -Werror' makes the package very easy to break with >>>> future GHC versions because new GHC versions often add new warnings. Use >>>> just 'ghc-options: -Wall' instead. >>>> Upload failed on hedis-0.8.1.tar.gz >>>> ``` >>>> >>>> Hope somebody can take a look. >>>> Thank you. >>>> >>>> _______________________________________________ >>>> Haskell-Cafe mailing list >>>> Haskell-Cafe at haskell.org >>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >>>> >>>> >>> >> > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From k-bx at k-bx.com Sun May 1 15:53:26 2016 From: k-bx at k-bx.com (Kostiantyn Rybnikov) Date: Sun, 1 May 2016 18:53:26 +0300 Subject: [Haskell-cafe] Hackage package upload error: Invalid package In-Reply-To: References: Message-ID: Thank you for taking time to investigate. Indeed, just removing those flags, uploading, and putting flags back helped for now. Cheers. On Sun, May 1, 2016 at 5:21 PM, Adam Bergmark wrote: > https://github.com/haskell/hackage-server/issues/360#issuecomment-215801249 > > On Sun, May 1, 2016 at 2:59 PM, Kostiantyn Rybnikov wrote: > >> Both -Werror and -auto-all should be hidden behind a "-dev" flag, so the >> warning is not really valid if I'm not mistaken. Plus, it had been there >> for a while now and worked before. >> >> Update regarding a tls error: it seems it doesn't happen now, the log is >> like this: >> >> ``` >> ? hedis git:(master) stack upload -v . >> Version 1.0.4.3, Git revision db1afb275ebd64016e8ef0db122f0f03da9e5906 >> (3242 commits) x86_64 >> 2016-05-01 15:59:16.723295: [debug] Checking for project config at: >> /home/kb/workspace/hedis/stack.yaml >> @(stack_JlzIf2rBNeuFEjNaHJwIZR:Stack.Config src/Stack/Config.hs:761:9) >> 2016-05-01 15:59:16.723597: [debug] Loading project config file >> stack.yaml @(stack_JlzIf2rBNeuFEjNaHJwIZR:Stack.Config >> src/Stack/Config.hs:779:13) >> 2016-05-01 15:59:16.761440: [debug] Checking for project config at: >> /home/kb/workspace/hedis/stack.yaml >> @(stack_JlzIf2rBNeuFEjNaHJwIZR:Stack.Config src/Stack/Config.hs:761:9) >> 2016-05-01 15:59:16.761726: [debug] Loading project config file >> stack.yaml @(stack_JlzIf2rBNeuFEjNaHJwIZR:Stack.Config >> src/Stack/Config.hs:779:13) >> 2016-05-01 15:59:16.764059: [debug] Run process: ldd /usr/bin/stack >> @(stack_JlzIf2rBNeuFEjNaHJwIZR:System.Process.Read >> src/System/Process/Read.hs:269:3) >> 2016-05-01 15:59:16.778551: [debug] Trying to decode >> /home/kb/.stack/build-plan-cache/x86_64-linux/lts-5.3.cache >> @(stack_JlzIf2rBNeuFEjNaHJwIZR:Data.Binary.VersionTagged >> src/Data/Binary/VersionTagged.hs:55:5) >> 2016-05-01 15:59:16.800503: [debug] Success decoding >> /home/kb/.stack/build-plan-cache/x86_64-linux/lts-5.3.cache >> @(stack_JlzIf2rBNeuFEjNaHJwIZR:Data.Binary.VersionTagged >> src/Data/Binary/VersionTagged.hs:64:13) >> 2016-05-01 15:59:16.800841: [debug] Trying to decode >> /home/kb/.stack/indices/Hackage/00-index.cache >> @(stack_JlzIf2rBNeuFEjNaHJwIZR:Data.Binary.VersionTagged >> src/Data/Binary/VersionTagged.hs:55:5) >> 2016-05-01 15:59:17.180117: [debug] Success decoding >> /home/kb/.stack/indices/Hackage/00-index.cache >> @(stack_JlzIf2rBNeuFEjNaHJwIZR:Data.Binary.VersionTagged >> src/Data/Binary/VersionTagged.hs:64:13) >> 2016-05-01 15:59:17.206082: [debug] Run process: ghc --info >> @(stack_JlzIf2rBNeuFEjNaHJwIZR:System.Process.Read >> src/System/Process/Read.hs:269:3) >> 2016-05-01 15:59:17.274505: [debug] Run process: ghc --numeric-version >> @(stack_JlzIf2rBNeuFEjNaHJwIZR:System.Process.Read >> src/System/Process/Read.hs:269:3) >> 2016-05-01 15:59:17.320953: [debug] Run process: ghc-pkg >> --no-user-package-db field --simple-output Cabal version >> @(stack_JlzIf2rBNeuFEjNaHJwIZR:System.Process.Read >> src/System/Process/Read.hs:269:3) >> 2016-05-01 15:59:17.349951: [debug] Run process: ghc-pkg >> --no-user-package-db list --global >> @(stack_JlzIf2rBNeuFEjNaHJwIZR:System.Process.Read >> src/System/Process/Read.hs:269:3) >> 2016-05-01 15:59:17.384645: [info] Getting file list for >> /home/kb/workspace/hedis/ @(stack_JlzIf2rBNeuFEjNaHJwIZR:Stack.SDist >> src/Stack/SDist.hs:96:5) >> 2016-05-01 15:59:17.388361: [debug] Checking resolver: lts-5.3 >> @(stack_JlzIf2rBNeuFEjNaHJwIZR:Stack.Build.Source >> src/Stack/Build/Source.hs:164:17) >> 2016-05-01 15:59:17.388599: [debug] Trying to decode >> /home/kb/.stack/build-plan-cache/x86_64-linux/lts-5.3.cache >> @(stack_JlzIf2rBNeuFEjNaHJwIZR:Data.Binary.VersionTagged >> src/Data/Binary/VersionTagged.hs:55:5) >> 2016-05-01 15:59:17.407773: [debug] Success decoding >> /home/kb/.stack/build-plan-cache/x86_64-linux/lts-5.3.cache >> @(stack_JlzIf2rBNeuFEjNaHJwIZR:Data.Binary.VersionTagged >> src/Data/Binary/VersionTagged.hs:64:13) >> 2016-05-01 15:59:17.438372: [debug] Run process: ghc-pkg >> --no-user-package-db list --global >> @(stack_JlzIf2rBNeuFEjNaHJwIZR:System.Process.Read >> src/System/Process/Read.hs:269:3) >> 2016-05-01 15:59:17.470217: [debug] Run process: >> /home/kb/.stack/setup-exe-cache/x86_64-linux/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3 >> --builddir=.stack-work/dist/x86_64-linux/Cabal-1.22.5.0 sdist >> --list-sources /tmp/stack-sdist11498/source-files-list >> @(stack_JlzIf2rBNeuFEjNaHJwIZR:System.Process.Read >> src/System/Process/Read.hs:287:3) >> 2016-05-01 15:59:17.523577: [info] Building sdist tarball for >> /home/kb/workspace/hedis/ @(stack_JlzIf2rBNeuFEjNaHJwIZR:Stack.SDist >> src/Stack/SDist.hs:98:5) >> 2016-05-01 15:59:17.565851: [info] Checking package 'hedis' for common >> mistakes @(stack_JlzIf2rBNeuFEjNaHJwIZR:Stack.SDist >> src/Stack/SDist.hs:274:5) >> 2016-05-01 15:59:17.566205: [warn] Package check reported the following >> warnings: >> 'ghc-options: -Wall -Werror' makes the package very easy to break with >> future GHC versions because new GHC versions often add new warnings. Use >> just 'ghc-options: -Wall' instead. >> 'ghc-prof-options: -auto-all' is fine during development, but not >> recommended in a distributed package. >> @(stack_JlzIf2rBNeuFEjNaHJwIZR:Stack.SDist src/Stack/SDist.hs:285:9) >> Uploading hedis-0.8.1.tar.gz... unhandled status code: 400 >> Error: Invalid package >> >> 'ghc-options: -Wall -Werror' makes the package very easy to break with >> future GHC versions because new GHC versions often add new warnings. Use >> just 'ghc-options: -Wall' instead. >> Upload failed on hedis-0.8.1.tar.gz >> ``` >> >> So, just status 400 somewhere. >> >> On Sun, May 1, 2016 at 3:50 PM, Michael Burge >> wrote: >> >>> For the TLS error, try generating the hackage-compatible file manually >>> and uploading through their web interface. If that succeeds, then you can >>> then ask where along the path from stack to hackage it differs from the >>> manual upload. If that fails, then I would test for packet corruption on >>> your end next. >>> >>> On Sun, May 1, 2016 at 5:37 AM, Michael Burge >>> wrote: >>> >>>> It gives you a warning at the end about the use of -Werror and >>>> -auto-all. If you remove those options, does it go through? >>>> >>>> On Sun, May 1, 2016 at 5:31 AM, Kostiantyn Rybnikov >>>> wrote: >>>> >>>>> Hi! >>>>> >>>>> Wanted to upload the 0.8.1 version of hedis, did what I usually did, >>>>> but getting an error. Running "stack -v upload ." seems to show some >>>>> tls-related details. >>>>> >>>>> ``` >>>>> ? hedis git:(master) stack -v upload . >>>>> Version 1.0.4.3 x86_64 >>>>> 2016-05-01 15:29:31.034044: [debug] Checking for project config at: >>>>> /Users/kb/workspace/hedis/stack.yaml >>>>> @(stack_2rXRdr1j02iFXWAif5re4K:Stack.Config src/Stack/Config.hs:761:9) >>>>> 2016-05-01 15:29:31.037100: [debug] Loading project config file >>>>> stack.yaml @(stack_2rXRdr1j02iFXWAif5re4K:Stack.Config >>>>> src/Stack/Config.hs:779:13) >>>>> 2016-05-01 15:29:31.110561: [debug] Checking for project config at: >>>>> /Users/kb/workspace/hedis/stack.yaml >>>>> @(stack_2rXRdr1j02iFXWAif5re4K:Stack.Config src/Stack/Config.hs:761:9) >>>>> 2016-05-01 15:29:31.110690: [debug] Loading project config file >>>>> stack.yaml @(stack_2rXRdr1j02iFXWAif5re4K:Stack.Config >>>>> src/Stack/Config.hs:779:13) >>>>> 2016-05-01 15:29:31.111459: [debug] Trying to decode >>>>> /Users/kb/.stack/build-plan-cache/x86_64-osx/lts-5.3.cache >>>>> @(stack_2rXRdr1j02iFXWAif5re4K:Data.Binary.VersionTagged >>>>> src/Data/Binary/VersionTagged.hs:55:5) >>>>> 2016-05-01 15:29:31.124939: [debug] Success decoding >>>>> /Users/kb/.stack/build-plan-cache/x86_64-osx/lts-5.3.cache >>>>> @(stack_2rXRdr1j02iFXWAif5re4K:Data.Binary.VersionTagged >>>>> src/Data/Binary/VersionTagged.hs:64:13) >>>>> 2016-05-01 15:29:31.132890: [debug] Trying to decode >>>>> /Users/kb/.stack/indices/Hackage/00-index.cache >>>>> @(stack_2rXRdr1j02iFXWAif5re4K:Data.Binary.VersionTagged >>>>> src/Data/Binary/VersionTagged.hs:55:5) >>>>> 2016-05-01 15:29:31.421690: [debug] Success decoding >>>>> /Users/kb/.stack/indices/Hackage/00-index.cache >>>>> @(stack_2rXRdr1j02iFXWAif5re4K:Data.Binary.VersionTagged >>>>> src/Data/Binary/VersionTagged.hs:64:13) >>>>> 2016-05-01 15:29:31.434522: [debug] Run process: ghc --info >>>>> @(stack_2rXRdr1j02iFXWAif5re4K:System.Process.Read >>>>> src/System/Process/Read.hs:269:3) >>>>> 2016-05-01 15:29:31.498337: [debug] Run process: ghc --numeric-version >>>>> @(stack_2rXRdr1j02iFXWAif5re4K:System.Process.Read >>>>> src/System/Process/Read.hs:269:3) >>>>> 2016-05-01 15:29:31.543696: [debug] Run process: ghc-pkg >>>>> --no-user-package-db field --simple-output Cabal version >>>>> @(stack_2rXRdr1j02iFXWAif5re4K:System.Process.Read >>>>> src/System/Process/Read.hs:269:3) >>>>> 2016-05-01 15:29:31.576011: [debug] Run process: ghc-pkg >>>>> --no-user-package-db list --global >>>>> @(stack_2rXRdr1j02iFXWAif5re4K:System.Process.Read >>>>> src/System/Process/Read.hs:269:3) >>>>> 2016-05-01 15:29:31.625682: [info] Getting file list for >>>>> /Users/kb/workspace/hedis/ @(stack_2rXRdr1j02iFXWAif5re4K:Stack.SDist >>>>> src/Stack/SDist.hs:96:5) >>>>> 2016-05-01 15:29:31.628599: [debug] Checking resolver: lts-5.3 >>>>> @(stack_2rXRdr1j02iFXWAif5re4K:Stack.Build.Source >>>>> src/Stack/Build/Source.hs:164:17) >>>>> 2016-05-01 15:29:31.628777: [debug] Trying to decode >>>>> /Users/kb/.stack/build-plan-cache/x86_64-osx/lts-5.3.cache >>>>> @(stack_2rXRdr1j02iFXWAif5re4K:Data.Binary.VersionTagged >>>>> src/Data/Binary/VersionTagged.hs:55:5) >>>>> 2016-05-01 15:29:31.636259: [debug] Success decoding >>>>> /Users/kb/.stack/build-plan-cache/x86_64-osx/lts-5.3.cache >>>>> @(stack_2rXRdr1j02iFXWAif5re4K:Data.Binary.VersionTagged >>>>> src/Data/Binary/VersionTagged.hs:64:13) >>>>> 2016-05-01 15:29:31.650120: [debug] Run process: ghc-pkg >>>>> --no-user-package-db list --global >>>>> @(stack_2rXRdr1j02iFXWAif5re4K:System.Process.Read >>>>> src/System/Process/Read.hs:269:3) >>>>> 2016-05-01 15:29:31.679601: [debug] Run process: >>>>> /Users/kb/.stack/setup-exe-cache/x86_64-osx/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3 >>>>> --builddir=.stack-work/dist/x86_64-osx/Cabal-1.22.5.0 sdist --list-sources >>>>> /private/var/folders/7l/3ys9j0lx20j6z69lm6s_9r780000gn/T/stack-sdist56408/source-files-list >>>>> @(stack_2rXRdr1j02iFXWAif5re4K:System.Process.Read >>>>> src/System/Process/Read.hs:287:3) >>>>> 2016-05-01 15:29:31.728919: [info] Building sdist tarball for >>>>> /Users/kb/workspace/hedis/ @(stack_2rXRdr1j02iFXWAif5re4K:Stack.SDist >>>>> src/Stack/SDist.hs:98:5) >>>>> 2016-05-01 15:29:31.756558: [info] Checking package 'hedis' for common >>>>> mistakes @(stack_2rXRdr1j02iFXWAif5re4K:Stack.SDist >>>>> src/Stack/SDist.hs:274:5) >>>>> 2016-05-01 15:29:31.758110: [warn] Package check reported the >>>>> following warnings: >>>>> 'ghc-options: -Wall -Werror' makes the package very easy to break with >>>>> future GHC versions because new GHC versions often add new warnings. Use >>>>> just 'ghc-options: -Wall' instead. >>>>> 'ghc-prof-options: -auto-all' is fine during development, but not >>>>> recommended in a distributed package. >>>>> @(stack_2rXRdr1j02iFXWAif5re4K:Stack.SDist src/Stack/SDist.hs:285:9) >>>>> Uploading hedis-0.8.1.tar.gz... TlsExceptionHostPort (HandshakeFailed >>>>> (Error_Packet_unexpected "Alert [(AlertLevel_Fatal,BadRecordMac)]" " >>>>> expected: change cipher")) "hackage.haskell.org" 443 >>>>> ? hedis git:(master) stack upload . >>>>> Getting file list for /Users/kb/workspace/hedis/ >>>>> Building sdist tarball for /Users/kb/workspace/hedis/ >>>>> Checking package 'hedis' for common mistakes >>>>> Package check reported the following warnings: >>>>> 'ghc-options: -Wall -Werror' makes the package very easy to break with >>>>> future GHC versions because new GHC versions often add new warnings. Use >>>>> just 'ghc-options: -Wall' instead. >>>>> 'ghc-prof-options: -auto-all' is fine during development, but not >>>>> recommended in a distributed package. >>>>> Uploading hedis-0.8.1.tar.gz... unhandled status code: 400 >>>>> Error: Invalid package >>>>> >>>>> 'ghc-options: -Wall -Werror' makes the package very easy to break with >>>>> future GHC versions because new GHC versions often add new warnings. Use >>>>> just 'ghc-options: -Wall' instead. >>>>> Upload failed on hedis-0.8.1.tar.gz >>>>> ``` >>>>> >>>>> Hope somebody can take a look. >>>>> Thank you. >>>>> >>>>> _______________________________________________ >>>>> Haskell-Cafe mailing list >>>>> Haskell-Cafe at haskell.org >>>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >>>>> >>>>> >>>> >>> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mitchellwrosen at gmail.com Sun May 1 17:54:26 2016 From: mitchellwrosen at gmail.com (Mitchell Rosen) Date: Sun, 1 May 2016 10:54:26 -0700 (PDT) Subject: [Haskell-cafe] cannot perform arithmetic with GHC.TypeLits? In-Reply-To: References: Message-ID: I think Carter is referring to this: http://hackage.haskell.org/package/ghc-typelits-natnormalise On Saturday, April 30, 2016 at 8:35:01 AM UTC-4, Carter Schonwald wrote: > > Use the type lits Nat solver plugin by Christian B, or a userland peano > encoding. Sadly ghc does have any builtin equational theory so you either > need to construct proofs yourself or use a plugin. > > I'm personally doing the plugin approach. If you would like to construct > the proofs by hand I'll dig up some examples later today if you like. > > On Saturday, April 30, 2016, Baojun Wang > > wrote: > >> Hi List, >> >> When I try to build below program, the compiler complains >> >> Couldn't match type ?n? with ?1 + (n - 1)? ? >> >> Why GHC (7.10.3) cannot do type level natural number arithmetic? `` n /= >> 1 + (n-1)`` at type level? >> >> -- | main.hs >> {-# LANGUAGE ScopedTypeVariables #-} >> {-# LANGUAGE FlexibleInstances #-} >> {-# LANGUAGE GADTs #-} >> {-# LANGUAGE PolyKinds #-} >> {-# LANGUAGE KindSignatures #-} >> {-# LANGUAGE TypeOperators #-} >> {-# LANGUAGE DataKinds #-} >> {-# LANGUAGE OverloadedStrings #-} >> {-# LANGUAGE DeriveGeneric #-} >> >> module Main where >> >> import qualified Data.ByteString as B >> import Data.ByteString(ByteString) >> import Data.Serialize -- require cereal >> >> import GHC.TypeLits >> >> data Scalar :: Nat -> * -> * where >> Nil :: Scalar 0 a >> Cons :: a -> Scalar m a -> Scalar (1+m) a >> >> instance (Serialize a) => Serialize (Scalar 0 a) where >> get = return Nil >> put _ = return $ mempty >> >> instance (Serialize a) => Serialize (Scalar n a) where >> get = do >> x <- get :: Get a >> xs <- get :: Get (Scalar (n-1) a) >> return $! Cons x xs >> put (Cons x xs) = do >> put (x :: a) >> put xs >> >> -- >> >> /tmp/vect1/app/Main.hs:31:15: Couldn't match type ?n? with ?1 + (n - 1)? ? >> ?n? is a rigid type variable bound by >> the instance declaration at /tmp/vect1/app/Main.hs:27:10 >> Expected type: Scalar n a >> Actual type: Scalar (1 + (n - 1)) a >> Relevant bindings include >> xs :: Scalar (n - 1) a (bound at /tmp/vect1/app/Main.hs:30:5) >> get :: Get (Scalar n a) (bound at /tmp/vect1/app/Main.hs:28:3) >> In the second argument of ?($!)?, namely ?Cons x xs? >> In a stmt of a 'do' block: return $! Cons x xs >> Compilation failed. >> >> - baojun >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From anakreonmejdi at gmail.com Sun May 1 17:59:09 2016 From: anakreonmejdi at gmail.com (Anakreontas) Date: Sun, 1 May 2016 10:59:09 -0700 (PDT) Subject: [Haskell-cafe] Transforming graphs with loops with Hoopl Message-ID: <02694661-0ba2-4a9b-96c5-cb1480dc1226@googlegroups.com> I am trying to implement a program transformation with Hoopl. The transformation replaces a particular statement with variable declarations provided that the variables have not been previously declared. A map keeps track of declared variables where the map keys store variable names. The transformation works only for programs without loops. In the program below, it should replace line 2 rec #3 INxt B37H00G with 1 Global Field B37H00G 2 Global Array B37HO3R 3 rec #3 INxt B37H00G but it doesn't. === Example graph == 0 goto L4 1 L4: 2 rec #3 INxt B37H00G 3 while #3 goto L5 goto L2 4 L5: 5 Global Field VSTF01a 6 goto L4 7 L2: I think the reason it fails is because there are two paths leading to L4, one from the program start (line 0) and a second when the loop repeats from line 6. In the first case the transformation produces the substitution graph since the two variables are not in the map. In the analysis of the second path however, the variables are in the name space so the rewrite function returns Nothing. In the end, the second transformation result is preserved (i.e. Nothing) and the graph is not transformed. Do I understand correctly why the transformation fails for loops? How would you suggest to solve this problem? Regards -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeffbrown.the at gmail.com Sun May 1 18:35:59 2016 From: jeffbrown.the at gmail.com (Jeffrey Brown) Date: Sun, 1 May 2016 11:35:59 -0700 Subject: [Haskell-cafe] Transforming graphs with loops with Hoopl In-Reply-To: <02694661-0ba2-4a9b-96c5-cb1480dc1226@googlegroups.com> References: <02694661-0ba2-4a9b-96c5-cb1480dc1226@googlegroups.com> Message-ID: What language is that? What does rec mean? L4 leads to the line "while #3 goto L5 goto L2". Does that mean go to L5 and then go to L2? If so, will L2 ever be gotten to, given that L5 leads back to L4? On Sun, May 1, 2016 at 10:59 AM, Anakreontas wrote: > I am trying to implement a program transformation with Hoopl. The > transformation replaces a particular statement with variable > declarations provided that the variables have not been previously > declared. A map keeps track of declared variables where the map keys > store variable names. > > The transformation works only for programs without loops. In the > program below, it should replace line > 2 rec #3 INxt B37H00G > with > 1 Global Field B37H00G > 2 Global Array B37HO3R > 3 rec #3 INxt B37H00G > but it doesn't. > > === Example graph == > 0 goto L4 > 1 L4: > 2 rec #3 INxt B37H00G > 3 while #3 goto L5 goto L2 > 4 L5: > 5 Global Field VSTF01a > 6 goto L4 > 7 L2: > > I think the reason it fails is because there are two paths leading to > L4, one from the program start (line 0) and a second when the loop > repeats from line 6. In the first case the transformation produces the > substitution graph since the two variables are not in the map. In the > analysis of the second path however, the variables are in the name space so > the rewrite function returns Nothing. In the end, the second > transformation result is preserved (i.e. Nothing) and the graph is not > transformed. > > Do I understand correctly why the transformation fails for loops? How > would you suggest to solve this problem? > > Regards > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > -- Jeffrey Benjamin Brown -------------- next part -------------- An HTML attachment was scrubbed... URL: From tab at snarc.org Mon May 2 06:11:26 2016 From: tab at snarc.org (Vincent Hanquez) Date: Mon, 2 May 2016 07:11:26 +0100 Subject: [Haskell-cafe] Hackage package upload error: Invalid package In-Reply-To: References: Message-ID: On 01/05/2016 13:31, Kostiantyn Rybnikov wrote: > Hi! > > Wanted to upload the 0.8.1 version of hedis, did what I usually did, > but getting an error. Running "stack -v upload ." seems to show some > tls-related details. > > 'ghc-options: -Wall -Werror' makes the package very easy to break with > future GHC versions because new GHC versions often add new warnings. > Use just 'ghc-options: -Wall' instead. > 'ghc-prof-options: -auto-all' is fine during development, but not > recommended in a distributed package. > @(stack_2rXRdr1j02iFXWAif5re4K:Stack.SDist src/Stack/SDist.hs:285:9) > Uploading hedis-0.8.1.tar.gz... TlsExceptionHostPort (HandshakeFailed > (Error_Packet_unexpected "Alert [(AlertLevel_Fatal,BadRecordMac)]" " > expected: change cipher")) "hackage.haskell.org > " 443 Hi Kostiantyn, Do you know which version of tls are you using ? tls < 1.3.5 that uses ECC have a serialisation bug that shows up like this every now and then. -- Vincent -------------- next part -------------- An HTML attachment was scrubbed... URL: From P.Achten at cs.ru.nl Mon May 2 07:04:11 2016 From: P.Achten at cs.ru.nl (Peter Achten) Date: Mon, 2 May 2016 09:04:11 +0200 Subject: [Haskell-cafe] [TFP'16] call for participation Message-ID: ----------------------------- C A L L F O R P A R T I C I P A T I O N ----------------------------- ======== TFP 2016 =========== 17th Symposium on Trends in Functional Programming June 8-10, 2016 University of Maryland, College Park Near Washington, DC http://tfp2016.org/ The symposium on Trends in Functional Programming (TFP) is an international forum for researchers with interests in all aspects of functional programming, taking a broad view of current and future trends in the area. It aspires to be a lively environment for presenting the latest research results, and other contributions (see below). Authors of draft papers will be invited to submit revised papers based on the feedback receive at the symposium. A post-symposium refereeing process will then select a subset of these articles for formal publication. TFP 2016 will be the main event of a pair of functional programming events. TFP 2016 will be accompanied by the International Workshop on Trends in Functional Programming in Education (TFPIE), which will take place on June 7nd. == INVITED SPEAKERS == TFP 2016 is pleased to announce keynote talks by the following two invited speakers: * Ronald Garcia, University of British Columbia: "Static and Dynamic Type Checking: A Synopsis" * Steve Zdancewic, University of Pennsylvania: "Type- and Example-Driven Program Synthesis" == HISTORY == The TFP symposium is the heir of the successful series of Scottish Functional Programming Workshops. Previous TFP symposia were held in * Edinburgh (Scotland) in 2003; * Munich (Germany) in 2004; * Tallinn (Estonia) in 2005; * Nottingham (UK) in 2006; * New York (USA) in 2007; * Nijmegen (The Netherlands) in 2008; * Komarno (Slovakia) in 2009; * Oklahoma (USA) in 2010; * Madrid (Spain) in 2011; * St. Andrews (UK) in 2012; * Provo (Utah, USA) in 2013; * Soesterberg (The Netherlands) in 2014; * and Inria Sophia-Antipolis (France) in 2015. For further general information about TFP please see the TFP homepage. (http://www.tifp.org/). == SCOPE == The symposium recognizes that new trends may arise through various routes. As part of the Symposium's focus on trends we therefore identify the following five article categories. High-quality articles are solicited in any of these categories: Research Articles: leading-edge, previously unpublished research work Position Articles: on what new trends should or should not be Project Articles: descriptions of recently started new projects Evaluation Articles: what lessons can be drawn from a finished project Overview Articles: summarizing work with respect to a trendy subject Articles must be original and not simultaneously submitted for publication to any other forum. They may consider any aspect of functional programming: theoretical, implementation-oriented, or experience-oriented. Applications of functional programming techniques to other languages are also within the scope of the symposium. Topics suitable for the symposium include, but are not limited to: Functional programming and multicore/manycore computing Functional programming in the cloud High performance functional computing Extra-functional (behavioural) properties of functional programs Dependently typed functional programming Validation and verification of functional programs Debugging and profiling for functional languages Functional programming in different application areas: security, mobility, telecommunications applications, embedded systems, global computing, grids, etc. Interoperability with imperative programming languages Novel memory management techniques Program analysis and transformation techniques Empirical performance studies Abstract/virtual machines and compilers for functional languages (Embedded) domain specific languages New implementation strategies Any new emerging trend in the functional programming area If you are in doubt on whether your article is within the scope of TFP, please contact the TFP 2016 program chair, David Van Horn. == BEST PAPER AWARDS == To reward excellent contributions, TFP awards a prize for the best paper accepted for the formal proceedings. TFP traditionally pays special attention to research students, acknowledging that students are almost by definition part of new subject trends. A student paper is one for which the authors state that the paper is mainly the work of students, the students are listed as first authors, and a student would present the paper. A prize for the best student paper is awarded each year. In both cases, it is the PC of TFP that awards the prize. In case the best paper happens to be a student paper, that paper will then receive both prizes. == SPONSORS == TFP is financially supported by CyberPoint, Galois, Trail of Bits, and the University of Maryland Computer Science Department. == PAPER SUBMISSIONS == Acceptance of articles for presentation at the symposium is based on a lightweight peer review process of extended abstracts (4 to 10 pages in length) or full papers (20 pages). The submission must clearly indicate which category it belongs to: research, position, project, evaluation, or overview paper. It should also indicate which authors are research students, and whether the main author(s) are students. A draft paper for which ALL authors are students will receive additional feedback by one of the PC members shortly after the symposium has taken place. We use EasyChair for the refereeing process. Papers must be submitted at: https://easychair.org/conferences/?conf=tfp2016 Papers must be written in English, and written using the LNCS style. For more information about formatting please consult the Springer LNCS web site: http://www.springer.com/computer/lncs?SGWID=0-164-6-793341-0 == IMPORTANT DATES == Submission of draft papers: April 25, 2016 Notification: May 2, 2016 Registration: May 13, 2016 TFP Symposium: June 8-10, 2016 Student papers feedback: June 14, 2016 Submission for formal review: July 14, 2016 Notification of acceptance: September 14, 2016 Camera ready paper: October 14, 2016 == PROGRAM COMMITTEE == Amal Ahmed Northeastern University (US) Nada Amin ?cole Polytechnique F?d?rale de Lausanne (CH) Kenichi Asai Ochanomizu University (JP) Ma?gorzata Biernacka University of Wroclaw (PL) Laura Castro University of A Coru?a (ES) Ravi Chugh University of Chicago (US) Silvia Ghilezan University of Novi Sad (SR) Clemens Grelck University of Amsterdam (NL) John Hughes Chalmers University of Technology (SE) Suresh Jagannathan Purdue University (US) Pieter Koopman Radboud University Nijmegen (NL) Geoffrey Mainland Drexel University (US) Chris Martens University of California, Santa Cruz (US) Jay McCarthy University of Massachusetts, Lowell (US) Heather Miller ?cole Polytechnique F?d?rale de Lausanne (CH) Manuel Serrano INRIA, Sophia-Antipolis (FR) Scott Smith Johns Hopkins University (US) ?ric Tanter University of Chile (CL) David Van Horn (Chair) University of Maryland (US) Niki Vazou University of California, San Diego (US) Stephanie Weirich University of Pennsylvania (US) From eir at cis.upenn.edu Mon May 2 14:05:13 2016 From: eir at cis.upenn.edu (Richard Eisenberg) Date: Mon, 2 May 2016 10:05:13 -0400 Subject: [Haskell-cafe] cannot perform arithmetic with GHC.TypeLits? In-Reply-To: References: Message-ID: <705717BD-4CF9-4184-B1C6-DB4EEAD3C1E3@cis.upenn.edu> There's also https://github.com/yav/type-nat-solver, which uses a Z3 backend to do the solving. I wonder how the two solvers compare. In your specific case, though: 1 + (n - 1) does *not* always equal n! If n is 0, then 1 + (n - 1) is 1, due to the partiality of (-). Always, always add before subtracting. Richard On May 1, 2016, at 1:54 PM, Mitchell Rosen wrote: > I think Carter is referring to this: http://hackage.haskell.org/package/ghc-typelits-natnormalise > > On Saturday, April 30, 2016 at 8:35:01 AM UTC-4, Carter Schonwald wrote: > Use the type lits Nat solver plugin by Christian B, or a userland peano encoding. Sadly ghc does have any builtin equational theory so you either need to construct proofs yourself or use a plugin. > > I'm personally doing the plugin approach. If you would like to construct the proofs by hand I'll dig up some examples later today if you like. > > On Saturday, April 30, 2016, Baojun Wang wrote: > Hi List, > > When I try to build below program, the compiler complains > > Couldn't match type ?n? with ?1 + (n - 1)? ? > > Why GHC (7.10.3) cannot do type level natural number arithmetic? `` n /= 1 + (n-1)`` at type level? > > -- | main.hs > {-# LANGUAGE ScopedTypeVariables #-} > {-# LANGUAGE FlexibleInstances #-} > {-# LANGUAGE GADTs #-} > {-# LANGUAGE PolyKinds #-} > {-# LANGUAGE KindSignatures #-} > {-# LANGUAGE TypeOperators #-} > {-# LANGUAGE DataKinds #-} > {-# LANGUAGE OverloadedStrings #-} > {-# LANGUAGE DeriveGeneric #-} > > module Main where > > import qualified Data.ByteString as B > import Data.ByteString(ByteString) > import Data.Serialize -- require cereal > > import GHC.TypeLits > > data Scalar :: Nat -> * -> * where > Nil :: Scalar 0 a > Cons :: a -> Scalar m a -> Scalar (1+m) a > > instance (Serialize a) => Serialize (Scalar 0 a) where > get = return Nil > put _ = return $ mempty > > instance (Serialize a) => Serialize (Scalar n a) where > get = do > x <- get :: Get a > xs <- get :: Get (Scalar (n-1) a) > return $! Cons x xs > put (Cons x xs) = do > put (x :: a) > put xs > > -- > > /tmp/vect1/app/Main.hs:31:15: Couldn't match type ?n? with ?1 + (n - 1)? ? > ?n? is a rigid type variable bound by > the instance declaration at /tmp/vect1/app/Main.hs:27:10 > Expected type: Scalar n a > Actual type: Scalar (1 + (n - 1)) a > Relevant bindings include > xs :: Scalar (n - 1) a (bound at /tmp/vect1/app/Main.hs:30:5) > get :: Get (Scalar n a) (bound at /tmp/vect1/app/Main.hs:28:3) > In the second argument of ?($!)?, namely ?Cons x xs? > In a stmt of a 'do' block: return $! Cons x xs > Compilation failed. > > - baojun > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe -------------- next part -------------- An HTML attachment was scrubbed... URL: From k-bx at k-bx.com Mon May 2 16:32:35 2016 From: k-bx at k-bx.com (Kostiantyn Rybnikov) Date: Mon, 2 May 2016 19:32:35 +0300 Subject: [Haskell-cafe] Hackage package upload error: Invalid package In-Reply-To: References: Message-ID: Hey Vincent, I don't know really, it's a latest stack release from brew. I'd expect it to be 1.3.5 as lts-5.14 has one. On Mon, May 2, 2016 at 9:11 AM, Vincent Hanquez wrote: > > > On 01/05/2016 13:31, Kostiantyn Rybnikov wrote: > > Hi! > > Wanted to upload the 0.8.1 version of hedis, did what I usually did, but > getting an error. Running "stack -v upload ." seems to show some > tls-related details. > > 'ghc-options: -Wall -Werror' makes the package very easy to break with > future GHC versions because new GHC versions often add new warnings. Use > just 'ghc-options: -Wall' instead. > 'ghc-prof-options: -auto-all' is fine during development, but not > recommended in a distributed package. > @(stack_2rXRdr1j02iFXWAif5re4K:Stack.SDist src/Stack/SDist.hs:285:9) > Uploading hedis-0.8.1.tar.gz... TlsExceptionHostPort (HandshakeFailed > (Error_Packet_unexpected "Alert [(AlertLevel_Fatal,BadRecordMac)]" " > expected: change cipher")) "hackage.haskell.org" 443 > > > Hi Kostiantyn, > > Do you know which version of tls are you using ? > tls < 1.3.5 that uses ECC have a serialisation bug that shows up like this > every now and then. > > -- > Vincent > -------------- next part -------------- An HTML attachment was scrubbed... URL: From k-bx at k-bx.com Mon May 2 16:33:41 2016 From: k-bx at k-bx.com (Kostiantyn Rybnikov) Date: Mon, 2 May 2016 19:33:41 +0300 Subject: [Haskell-cafe] Hackage package upload error: Invalid package In-Reply-To: References: Message-ID: Actually, sorry, you are right. I've chosen the "1.0.4.2" tag and there stack has lts-5.0 which has tls 1.3.4. Nice catch! On Mon, May 2, 2016 at 9:11 AM, Vincent Hanquez wrote: > > > On 01/05/2016 13:31, Kostiantyn Rybnikov wrote: > > Hi! > > Wanted to upload the 0.8.1 version of hedis, did what I usually did, but > getting an error. Running "stack -v upload ." seems to show some > tls-related details. > > 'ghc-options: -Wall -Werror' makes the package very easy to break with > future GHC versions because new GHC versions often add new warnings. Use > just 'ghc-options: -Wall' instead. > 'ghc-prof-options: -auto-all' is fine during development, but not > recommended in a distributed package. > @(stack_2rXRdr1j02iFXWAif5re4K:Stack.SDist src/Stack/SDist.hs:285:9) > Uploading hedis-0.8.1.tar.gz... TlsExceptionHostPort (HandshakeFailed > (Error_Packet_unexpected "Alert [(AlertLevel_Fatal,BadRecordMac)]" " > expected: change cipher")) "hackage.haskell.org" 443 > > > Hi Kostiantyn, > > Do you know which version of tls are you using ? > tls < 1.3.5 that uses ECC have a serialisation bug that shows up like this > every now and then. > > -- > Vincent > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wangbj at gmail.com Mon May 2 17:24:34 2016 From: wangbj at gmail.com (Baojun Wang) Date: Mon, 02 May 2016 17:24:34 +0000 Subject: [Haskell-cafe] cannot perform arithmetic with GHC.TypeLits? In-Reply-To: <705717BD-4CF9-4184-B1C6-DB4EEAD3C1E3@cis.upenn.edu> References: <705717BD-4CF9-4184-B1C6-DB4EEAD3C1E3@cis.upenn.edu> Message-ID: ghc-typelits-natnormalise worked for the example. Tried type-nat-solver too, however, got bellow error (maybe just because my cabal setup): z3: runInteractiveProcess: runInteractiveProcess: exec: does not exist (No such file or directory) Thanks to all for your solutions, first time tried GHC plugins :) Also I'm wondering if GHC 8.0 could make this easier? couldn't wait to try GHC 8.0 -- baojun On Mon, May 2, 2016 at 7:05 AM Richard Eisenberg wrote: > There's also https://github.com/yav/type-nat-solver, which uses a Z3 > backend to do the solving. I wonder how the two solvers compare. > > In your specific case, though: 1 + (n - 1) does *not* always equal n! If n > is 0, then 1 + (n - 1) is 1, due to the partiality of (-). Always, always > add before subtracting. > > Richard > > On May 1, 2016, at 1:54 PM, Mitchell Rosen > wrote: > > I think Carter is referring to this: > http://hackage.haskell.org/package/ghc-typelits-natnormalise > > On Saturday, April 30, 2016 at 8:35:01 AM UTC-4, Carter Schonwald wrote: >> >> Use the type lits Nat solver plugin by Christian B, or a userland peano >> encoding. Sadly ghc does have any builtin equational theory so you either >> need to construct proofs yourself or use a plugin. >> >> I'm personally doing the plugin approach. If you would like to construct >> the proofs by hand I'll dig up some examples later today if you like. >> >> On Saturday, April 30, 2016, Baojun Wang wrote: >> >>> Hi List, >>> >>> When I try to build below program, the compiler complains >>> >>> Couldn't match type ?n? with ?1 + (n - 1)? ? >>> >>> Why GHC (7.10.3) cannot do type level natural number arithmetic? `` n /= >>> 1 + (n-1)`` at type level? >>> >>> -- | main.hs >>> {-# LANGUAGE ScopedTypeVariables #-} >>> {-# LANGUAGE FlexibleInstances #-} >>> {-# LANGUAGE GADTs #-} >>> {-# LANGUAGE PolyKinds #-} >>> {-# LANGUAGE KindSignatures #-} >>> {-# LANGUAGE TypeOperators #-} >>> {-# LANGUAGE DataKinds #-} >>> {-# LANGUAGE OverloadedStrings #-} >>> {-# LANGUAGE DeriveGeneric #-} >>> >>> module Main where >>> >>> import qualified Data.ByteString as B >>> import Data.ByteString(ByteString) >>> import Data.Serialize -- require cereal >>> >>> import GHC.TypeLits >>> >>> data Scalar :: Nat -> * -> * where >>> Nil :: Scalar 0 a >>> Cons :: a -> Scalar m a -> Scalar (1+m) a >>> >>> instance (Serialize a) => Serialize (Scalar 0 a) where >>> get = return Nil >>> put _ = return $ mempty >>> >>> instance (Serialize a) => Serialize (Scalar n a) where >>> get = do >>> x <- get :: Get a >>> xs <- get :: Get (Scalar (n-1) a) >>> return $! Cons x xs >>> put (Cons x xs) = do >>> put (x :: a) >>> put xs >>> >>> -- >>> >>> /tmp/vect1/app/Main.hs:31:15: Couldn't match type ?n? with ?1 + (n - 1)? >>> ? >>> ?n? is a rigid type variable bound by >>> the instance declaration at /tmp/vect1/app/Main.hs:27:10 >>> Expected type: Scalar n a >>> Actual type: Scalar (1 + (n - 1)) a >>> Relevant bindings include >>> xs :: Scalar (n - 1) a (bound at /tmp/vect1/app/Main.hs:30:5) >>> get :: Get (Scalar n a) (bound at /tmp/vect1/app/Main.hs:28:3) >>> In the second argument of ?($!)?, namely ?Cons x xs? >>> In a stmt of a 'do' block: return $! Cons x xs >>> Compilation failed. >>> >>> - baojun >>> >> _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From _deepfire at feelingofgreen.ru Mon May 2 17:47:45 2016 From: _deepfire at feelingofgreen.ru (Kosyrev Serge) Date: Mon, 02 May 2016 20:47:45 +0300 Subject: [Haskell-cafe] cannot perform arithmetic with GHC.TypeLits? In-Reply-To: (Baojun Wang's message of "Mon, 02 May 2016 17:24:34 +0000") References: <705717BD-4CF9-4184-B1C6-DB4EEAD3C1E3@cis.upenn.edu> Message-ID: <87d1p4uzb2.fsf@andromedae.feelingofgreen.ru> Baojun Wang writes: > ghc-typelits-natnormalise worked for the example. Tried > type-nat-solver too, however, got bellow error (maybe just because my > cabal setup): > > z3: runInteractiveProcess: runInteractiveProcess: exec: does not exist > (No such file or directory) These runInteractiveProcess errors are *notoriously* unintelligible, reliably confusing every single person seeing them for the first time.. In this case the 'z3' executable is missing -- most likely due to the Z3 solver not installed on your machine. -- ? ???????e? / respectfully, ??????? ?????? From wangbj at gmail.com Mon May 2 18:36:08 2016 From: wangbj at gmail.com (Baojun Wang) Date: Mon, 02 May 2016 18:36:08 +0000 Subject: [Haskell-cafe] cannot perform arithmetic with GHC.TypeLits? In-Reply-To: <87d1p4uzb2.fsf@andromedae.feelingofgreen.ru> References: <705717BD-4CF9-4184-B1C6-DB4EEAD3C1E3@cis.upenn.edu> <87d1p4uzb2.fsf@andromedae.feelingofgreen.ru> Message-ID: Yeah the error message was really confusing. Install z3 solver fixed the issue. - baojun On Mon, May 2, 2016 at 10:47 AM Kosyrev Serge <_deepfire at feelingofgreen.ru> wrote: > Baojun Wang writes: > > ghc-typelits-natnormalise worked for the example. Tried > > type-nat-solver too, however, got bellow error (maybe just because my > > cabal setup): > > > > z3: runInteractiveProcess: runInteractiveProcess: exec: does not exist > > (No such file or directory) > > These runInteractiveProcess errors are *notoriously* unintelligible, > reliably confusing every single person seeing them for the first time.. > > In this case the 'z3' executable is missing -- most likely due to the Z3 > solver not installed on your machine. > > -- > ? ???????e? / respectfully, > ??????? ?????? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.bracker at googlemail.com Mon May 2 18:40:02 2016 From: jan.bracker at googlemail.com (Jan Bracker) Date: Mon, 2 May 2016 19:40:02 +0100 Subject: [Haskell-cafe] Applications using generalized monads? Message-ID: Hello, I am currently looking into applications of generalized monads. I am aware of the following generalized monad concepts (and libraries implementing them): * Indexed/Parameterized/Hoare Monads [1] * indexed [8] * simple-sessions [9][4] * monad-param [10][3][6] * Effect Monads [2] * effect-monad [11][5] * monad-param [12][3] * Constrained Monads * rmonad [13] Question 1: Do you know of other libraries that implement generalized monad concepts? Most of the libraries I listed above are in working condition, but still outdated. Question 2: Do you know of (open source) software and applications that use these concepts/libraries to implement something? This mail is a copy of my post on Reddit [7]. I am sorry for reposting it here, but I dod not get a response on that post for almost 2 weeks now. Best, Jan [1]: http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.104.3020 [2]: http://dl.acm.org/citation.cfm?doid=2578855.2535846 [3]: http://comonad.com/reader/2007/parameterized-monads-in-haskell/ [4]: http://www.ccs.neu.edu/home/tov/pubs/haskell-session-types/session08.pdf [5]: https://www.cl.cam.ac.uk/~dao29/publ/haskell14-effects.pdf [6]: http://www.researchgate.net/profile/Dominique_Devriese/publication/221282353_Information_flow_enforcement_in_monadic_libraries/links/02e7e517426092952d000000.pdf [7]: https://www.reddit.com/r/haskellquestions/comments/4fs80x/ [8]: http://hackage.haskell.org/package/indexed [9]: http://hackage.haskell.org/package/simple-sessions [10]: http://hackage.haskell.org/package/monad-param [11]: http://hackage.haskell.org/package/effect-monad [12]: http://hackage.haskell.org/package/monad-param [13]: http://hackage.haskell.org/package/rmonad -------------- next part -------------- An HTML attachment was scrubbed... URL: From eir at cis.upenn.edu Mon May 2 20:10:50 2016 From: eir at cis.upenn.edu (Richard Eisenberg) Date: Mon, 2 May 2016 16:10:50 -0400 Subject: [Haskell-cafe] Bikeshedding request for GHCi's :type In-Reply-To: <60D162E7-9FAE-45AE-BD22-9E1C6D6C7466@cis.upenn.edu> References: <60D162E7-9FAE-45AE-BD22-9E1C6D6C7466@cis.upenn.edu> Message-ID: I have collected feedback gleaned here, on the ticket, and on reddit and summarized here: https://ghc.haskell.org/trac/ghc/wiki/Design/GHCi/Type#Summaryoffeedbackaboutthisissue That summary includes this concrete proposal: 1. Ask for concrete suggestions about names for the new commands. 2. Use these names on my current implementation (which prints out only one specialization) 3. Post a feature request looking for more specializations. I simply don't have time to specify a design or implement an algorithm for printing out multiple specializations. Furthermore, my current implementation meets all specifications proffered for printing out multiple specializations, for all values of "multiple" that equal 1. It is easy to extend later. Separately, there is a groundswell of support for :doc, but that's beyond the scope of my work on this point. (I personally would love :doc, too.) So, what shall we name the two new commands? 1. A new command that specializes a type. (Currently with one specialization, but perhaps more examples in the future.) 2. A new command that preserves specialized type variables so that users of TypeApplications know what type parameters to pass in next. I have suggested :type-def for (1) and :type-spec for (2). I don't strongly like either. :examples and :inst have been suggested for (1). Any other ideas? Thanks! Richard On Apr 26, 2016, at 9:08 AM, Richard Eisenberg wrote: > Hi devs, > > Over the weekend, I was pondering the Haskell course I will be teaching next year and shuddered at having to teach Foldable at the same time as `length`. So I implemented feature request #10963 (https://ghc.haskell.org/trac/ghc/ticket/10963), which allows for a way for a user to request a specialization of a type. It all works wonderfully, but there is a real user-facing design issue here around the default behavior of :type and whether or not to add new :type-y like commands. I have outlined the situation here: https://ghc.haskell.org/trac/ghc/wiki/Design/GHCi/Type > > I'd love some broad input on this issue. If you've got a stake in how this all works, please skim that wiki page and comment on #10963. > > Thanks! > Richard > _______________________________________________ > ghc-devs mailing list > ghc-devs at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs From eric at seidel.io Mon May 2 20:36:53 2016 From: eric at seidel.io (Eric Seidel) Date: Mon, 02 May 2016 13:36:53 -0700 Subject: [Haskell-cafe] Bikeshedding request for GHCi's :type In-Reply-To: References: <60D162E7-9FAE-45AE-BD22-9E1C6D6C7466@cis.upenn.edu> Message-ID: <1462221413.1357025.595998097.000958C2@webmail.messagingengine.com> On Mon, May 2, 2016, at 13:10, Richard Eisenberg wrote: > So, what shall we name the two new commands? > > 1. A new command that specializes a type. (Currently with one > specialization, but perhaps more examples in the future.) > > 2. A new command that preserves specialized type variables so that users > of TypeApplications know what type parameters to pass in next. > > I have suggested :type-def for (1) and :type-spec for (2). I don't > strongly like either. :examples and :inst have been suggested for (1). > Any other ideas? This might be overly pedantic of me, but :type-def seems way too similar to typedef, which means something entirely different in common parlance (even though we don't use that word in Haskell-land). We should at least call it :type-default; GHCi should be able to disambiguate the shorter :type-def. Also, I'd suggest making (1) and (2) optional flags for :type rather than new top-level commands. The shared prefix already suggests a common purpose, printing out the type of something, so why not make it even clearer that (1) and (2) are just specializations (heh) of :type? Eric From eir at cis.upenn.edu Mon May 2 20:39:14 2016 From: eir at cis.upenn.edu (Richard Eisenberg) Date: Mon, 2 May 2016 16:39:14 -0400 Subject: [Haskell-cafe] Bikeshedding request for GHCi's :type In-Reply-To: <1462221413.1357025.595998097.000958C2@webmail.messagingengine.com> References: <60D162E7-9FAE-45AE-BD22-9E1C6D6C7466@cis.upenn.edu> <1462221413.1357025.595998097.000958C2@webmail.messagingengine.com> Message-ID: <7799A916-63BA-487C-9D08-FDE3ECF7CA91@cis.upenn.edu> On May 2, 2016, at 4:36 PM, Eric Seidel wrote: > Also, I'd suggest making (1) and (2) optional flags for :type rather > than new top-level commands. The shared prefix already suggests a common > purpose, printing out the type of something, so why not make it even > clearer that (1) and (2) are just specializations (heh) of :type? Others have echoed this and I'm open to the idea. But I, personally, dislike this. All three commands are useful, and I expect I'll want to frequently interleave which one I want during a GHCi session. Controlling via a flag makes this awkward. But that's just my 2?. > > Eric > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe From jhenahan at me.com Mon May 2 20:43:02 2016 From: jhenahan at me.com (Jack Henahan) Date: Mon, 02 May 2016 16:43:02 -0400 Subject: [Haskell-cafe] Bikeshedding request for GHCi's :type In-Reply-To: <7799A916-63BA-487C-9D08-FDE3ECF7CA91@cis.upenn.edu> References: <60D162E7-9FAE-45AE-BD22-9E1C6D6C7466@cis.upenn.edu> <1462221413.1357025.595998097.000958C2@webmail.messagingengine.com> <7799A916-63BA-487C-9D08-FDE3ECF7CA91@cis.upenn.edu> Message-ID: <2EE8C1DB-4CBF-4097-92C1-ABDA5CF60DB5@me.com> What about :type for the normal behavior and :type! for specializations? With the notion that it could be extended to provide multiple specializations, I could also see :types (both meaning "display multiple example types" and serving as a mnemonic for :types[pecialization]) being viable. > On May 2, 2016, at 4:39 PM, Richard Eisenberg wrote: > > > On May 2, 2016, at 4:36 PM, Eric Seidel wrote: > >> Also, I'd suggest making (1) and (2) optional flags for :type rather >> than new top-level commands. The shared prefix already suggests a common >> purpose, printing out the type of something, so why not make it even >> clearer that (1) and (2) are just specializations (heh) of :type? > > Others have echoed this and I'm open to the idea. But I, personally, dislike this. All three commands are useful, and I expect I'll want to frequently interleave which one I want during a GHCi session. Controlling via a flag makes this awkward. > > But that's just my 2?. > >> >> Eric >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 842 bytes Desc: Message signed with OpenPGP using GPGMail URL: From eric at seidel.io Mon May 2 20:47:35 2016 From: eric at seidel.io (Eric Seidel) Date: Mon, 02 May 2016 13:47:35 -0700 Subject: [Haskell-cafe] Bikeshedding request for GHCi's :type In-Reply-To: <7799A916-63BA-487C-9D08-FDE3ECF7CA91@cis.upenn.edu> References: <60D162E7-9FAE-45AE-BD22-9E1C6D6C7466@cis.upenn.edu> <1462221413.1357025.595998097.000958C2@webmail.messagingengine.com> <7799A916-63BA-487C-9D08-FDE3ECF7CA91@cis.upenn.edu> Message-ID: <1462222055.1359142.596022705.3C32AFC3@webmail.messagingengine.com> On Mon, May 2, 2016, at 13:39, Richard Eisenberg wrote: > > On May 2, 2016, at 4:36 PM, Eric Seidel wrote: > > > Also, I'd suggest making (1) and (2) optional flags for :type rather > > than new top-level commands. The shared prefix already suggests a common > > purpose, printing out the type of something, so why not make it even > > clearer that (1) and (2) are just specializations (heh) of :type? > > Others have echoed this and I'm open to the idea. But I, personally, > dislike this. All three commands are useful, and I expect I'll want to > frequently interleave which one I want during a GHCi session. Controlling > via a flag makes this awkward. > > But that's just my 2?. Ah, I was talking about a different kind of flag this time. Instead of a GHCi-level flag (or maybe in addition to..), I was thinking about a flag specifically associated with an invocation of :type, e.g. ghci> :type length Foldable t => t a -> Int ghci> :type -default length [a] -> Int It's very nitpicky, I know, but I think the added grouping would be nice, in particular w.r.t. the output of :help. Eric From will.yager at gmail.com Tue May 3 00:20:59 2016 From: will.yager at gmail.com (William Yager) Date: Mon, 2 May 2016 19:20:59 -0500 Subject: [Haskell-cafe] Bikeshedding request for GHCi's :type In-Reply-To: <2EE8C1DB-4CBF-4097-92C1-ABDA5CF60DB5@me.com> References: <60D162E7-9FAE-45AE-BD22-9E1C6D6C7466@cis.upenn.edu> <1462221413.1357025.595998097.000958C2@webmail.messagingengine.com> <7799A916-63BA-487C-9D08-FDE3ECF7CA91@cis.upenn.edu> <2EE8C1DB-4CBF-4097-92C1-ABDA5CF60DB5@me.com> Message-ID: +1 to ":types". Easy to remember as well: "Do I want one type, or multiple types?". On Mon, May 2, 2016 at 3:43 PM, Jack Henahan wrote: > What about :type for the normal behavior and :type! for specializations? > With the notion that it could be extended to provide multiple > specializations, I could also see :types (both meaning "display multiple > example types" and serving as a mnemonic for :types[pecialization]) being > viable. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Tue May 3 01:05:00 2016 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Mon, 2 May 2016 21:05:00 -0400 Subject: [Haskell-cafe] Bikeshedding request for GHCi's :type In-Reply-To: <7799A916-63BA-487C-9D08-FDE3ECF7CA91@cis.upenn.edu> References: <60D162E7-9FAE-45AE-BD22-9E1C6D6C7466@cis.upenn.edu> <1462221413.1357025.595998097.000958C2@webmail.messagingengine.com> <7799A916-63BA-487C-9D08-FDE3ECF7CA91@cis.upenn.edu> Message-ID: I'm inclined to agree with Richard on this. Flag based behavior pushes more Complexity into the meaning of a command. Zero config is best config, and thusly having easy way to distinguish these (using the power of names!) is something I personally agree with Perhaps just as importantly: ~/.ghci files are a thing, so it'd be easy for folks to define custom short hands if they like. And we literally don't know yet how instructional use will help refine what the end state should be :) On Monday, May 2, 2016, Richard Eisenberg wrote: > > On May 2, 2016, at 4:36 PM, Eric Seidel > > wrote: > > > Also, I'd suggest making (1) and (2) optional flags for :type rather > > than new top-level commands. The shared prefix already suggests a common > > purpose, printing out the type of something, so why not make it even > > clearer that (1) and (2) are just specializations (heh) of :type? > > Others have echoed this and I'm open to the idea. But I, personally, > dislike this. All three commands are useful, and I expect I'll want to > frequently interleave which one I want during a GHCi session. Controlling > via a flag makes this awkward. > > But that's just my 2?. > > > > > Eric > > _______________________________________________ > > Haskell-Cafe mailing list > > Haskell-Cafe at haskell.org > > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at schmong.org Tue May 3 01:52:40 2016 From: michael at schmong.org (Michael Litchard) Date: Mon, 2 May 2016 18:52:40 -0700 Subject: [Haskell-cafe] Controlling how test data is generated in QuickCheck 2 Message-ID: I have a problem similar to this question < http://stackoverflow.com/questions/9977734/controlling-how-test-data-is-generated-in-quickcheck>. Below I will articulate my specifics, the code I am using, and the particular question I have. I have written a fizz-buzz program that uses a Fibonacci sequence as input. I would like to test two things. (1) Does my program emit the correct string given an Int that meets a particular condition. (2) Is my Fibonacci generator generating Fibonacci numbers? The problem I am having is similar to the link above. The range of `Int`s is too large. How do I constrain my tests to say, the first 1000 Fibonacci numbers? Here is code that I think is both adequate and minimal. Please let me know if I need to elaborate. import Data.Numbers.Primes (isPrime) import Test.Hspec (Spec,hspec,describe,it,shouldBe) import Test.Hspec.QuickCheck (prop) qcheck :: Spec qcheck = do describe "QuickCheck test fiz" $ prop "QuickCheck test" $ modfiz describe "QuickCheck test fib" $ prop "QuickCheck test fib" $ testfib modfiz int | int <= 0 = True -- code smell, should never generate number less than or equal to zero. | int == 3 = test3 | int == 5 = test5 | int `mod` 15 == 0 = testMod35 | int `mod` 3 == 0 = testMod3 | int `mod` 5 == 0 = testMod5 | isPrime int == True = testPrime | otherwise = testRest where test3 = Right "Buzz BuzzFizz" == fizzbuzz 3 test5 = Right "Fizz BuzzFizz" == fizzbuzz 5 testMod3 = Right "Buzz " == fizzbuzz int testMod5 = Right "Fizz " == fizzbuzz int testMod35 = Right "Buzz Fizz " == fizzbuzz int testPrime = Right "BuzzFizz" == fizzbuzz int testRest = Right (show int) == fizzbuzz int testfib :: Integer -> Bool testfib n = case (fibb n) of Left _ -> False Right n' -> isFib n' `fibb` takes an `Int` and finds that nth Fibonacci. So `fibb 6` would return `Right 8`. The `Left` value is not relevant to this problem. What I noticed was the answer suggested that one should write a `newtype`, wrapping a `[Int]` and making a new `Arbitrary` instance. However, I also noticed that the answer is from 2012, and `QuickCheck 2` has an `Args` `datatype` that appears to be able to do what I need. So, can I create a new `Args` to limit the range of tests, (just want the first 1000 Fibonacci numbers), and also to limit the number of tests run? If not is the solution from the above link the approach I would have to take? the entire project here -------------- next part -------------- An HTML attachment was scrubbed... URL: From ollie at ocharles.org.uk Tue May 3 10:20:50 2016 From: ollie at ocharles.org.uk (Oliver Charles) Date: Tue, 3 May 2016 11:20:50 +0100 Subject: [Haskell-cafe] Could Haddock export documentation with type family applications normalised? Message-ID: Hi all, I'm working on a library that uses quite a lot of type "magic" (as some would call it), but really it's all just implementation details. The type families are necessary for me to write the code, but an outside understanding of these type families shouldn't be necessary to understand the library. Unfortunately, Haddock does not align with that goal. To give you a feeling for things, take the following types: data Expr (t :: k) data AsHaskell (t :: k) data BaseType = DBInt | DBText type family Col (f :: k -> *) (a :: k) :: * type instance Col Expr (a :: BaseType) = Expr a type instance Col AsHaskell (a :: BaseType) = BaseTypeAsHaskell a type family BaseTypeAsHaskell (bt :: BaseType) :: * where BaseTypeAsHaskell 'DBInt = Int BaseTypeAsHaskell 'DBText = String class Lit (exprType :: k) where lit :: Col AsHaskell exprType -> Expr exprType instance Lit 'DBInt where lit = ... instance Lit 'DBText where lit = ... (I am modelling the interaction with remote relational databases, to provide a little more context) Now when I export this, I end up with the following: Fine, not much needs to change there. Haddock now also gives me specialised types for instances, but these don't go far enough: Instances Lit BaseType DBInt Methods lit :: Col (TYPE Lifted) DBInt (AsHaskell DBInt) exprType -> Expr DBInt exprType But this is considerably less helpful: First, it seems to be broken, as it mentions the exprType variable, when is just DBint. Secondly, it mentions all sorts of kinds which are, in my opinion, unreadable in the current form. All of these problems would be solved if we just normalised this type family application as far as possible. What I *really* want to export is: Instances Lit DBInt Methods lit :: Int -> Expr DBInt This is the type I want my users to be aware of. Has this been discussed before? If not, how do people feel about this? Ollie -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail at joachim-breitner.de Tue May 3 10:43:24 2016 From: mail at joachim-breitner.de (Joachim Breitner) Date: Tue, 03 May 2016 12:43:24 +0200 Subject: [Haskell-cafe] Could Haddock export documentation with type family applications normalised? In-Reply-To: References: Message-ID: <1462272204.7888.21.camel@joachim-breitner.de> Hi, Am Dienstag, den 03.05.2016, 11:20 +0100 schrieb Oliver Charles: > Has this been discussed before? If not, how do people feel about > this? there will be people who want normalised types, and others will want the original types, so I expect that we will not agree on one particular behavior. But since the usual scheme is that haddock should print what is written in the source, if there is something, then the InstanceSigs extension should help you: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/type-cl ass-extensions.html#instance-sigs Have you checked if haddock is maybe already paying attention to such signatures? Greetings, Joachim -- Joachim ?nomeata? Breitner ? mail at joachim-breitner.de ? https://www.joachim-breitner.de/ ? XMPP: nomeata at joachim-breitner.de?? OpenPGP-Key: 0xF0FBF51F ? Debian Developer: nomeata at debian.org -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: This is a digitally signed message part URL: From takenobu.hs at gmail.com Tue May 3 15:14:33 2016 From: takenobu.hs at gmail.com (Takenobu Tani) Date: Wed, 4 May 2016 00:14:33 +0900 Subject: [Haskell-cafe] Bikeshedding request for GHCi's :type In-Reply-To: References: <60D162E7-9FAE-45AE-BD22-9E1C6D6C7466@cis.upenn.edu> Message-ID: Hi Richard, I like your decision and plan. Thank you a lot of work, for community. About new command name for (1): Most users, perhaps, have entered the `:t` rather than `:type`. ghci> :t length In the same way, how about a full name and abbreviation name for (1). For example, we prepare `:type-default` and `:td`. ghci> :td length So they don't misunderstand that it is "typedef". I also like `:type!` and `:types` with Jack :) ghci> :t! length Regards, Takenobu 2016-05-03 5:10 GMT+09:00 Richard Eisenberg : > I have collected feedback gleaned here, on the ticket, and on reddit and > summarized here: > https://ghc.haskell.org/trac/ghc/wiki/Design/GHCi/Type#Summaryoffeedbackaboutthisissue > > That summary includes this concrete proposal: > 1. Ask for concrete suggestions about names for the new commands. > 2. Use these names on my current implementation (which prints out only > one specialization) > 3. Post a feature request looking for more specializations. > > I simply don't have time to specify a design or implement an algorithm for > printing out multiple specializations. Furthermore, my current > implementation meets all specifications proffered for printing out multiple > specializations, for all values of "multiple" that equal 1. It is easy to > extend later. > > Separately, there is a groundswell of support for :doc, but that's beyond > the scope of my work on this point. (I personally would love :doc, too.) > > So, what shall we name the two new commands? > > 1. A new command that specializes a type. (Currently with one > specialization, but perhaps more examples in the future.) > > 2. A new command that preserves specialized type variables so that users > of TypeApplications know what type parameters to pass in next. > > I have suggested :type-def for (1) and :type-spec for (2). I don't > strongly like either. :examples and :inst have been suggested for (1). Any > other ideas? > > Thanks! > Richard > > On Apr 26, 2016, at 9:08 AM, Richard Eisenberg wrote: > > > Hi devs, > > > > Over the weekend, I was pondering the Haskell course I will be teaching > next year and shuddered at having to teach Foldable at the same time as > `length`. So I implemented feature request #10963 ( > https://ghc.haskell.org/trac/ghc/ticket/10963), which allows for a way > for a user to request a specialization of a type. It all works wonderfully, > but there is a real user-facing design issue here around the default > behavior of :type and whether or not to add new :type-y like commands. I > have outlined the situation here: > https://ghc.haskell.org/trac/ghc/wiki/Design/GHCi/Type > > > > I'd love some broad input on this issue. If you've got a stake in how > this all works, please skim that wiki page and comment on #10963. > > > > Thanks! > > Richard > > _______________________________________________ > > ghc-devs mailing list > > ghc-devs at haskell.org > > http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From li-yao.xia at ens.fr Tue May 3 13:31:38 2016 From: li-yao.xia at ens.fr (Li-yao Xia) Date: Tue, 3 May 2016 15:31:38 +0200 Subject: [Haskell-cafe] Controlling how test data is generated in, QuickCheck 2 In-Reply-To: References: Message-ID: Hi Michael, > What I noticed was the answer suggested that one should write a `newtype`, > wrapping a `[Int]` and making a new `Arbitrary` instance. However, I also > noticed that the answer is from 2012, and `QuickCheck 2` has an `Args` > `datatype` that appears to be able to do what I need. So, can I create a > new `Args` to limit the range of tests, (just want the first 1000 Fibonacci > numbers), and also to limit the number of tests run? If not is the solution > from the above link the approach I would have to take? The module Test.Hspec.QuickCheck has functions to modify the number of tests to be run (modifyMaxSuccess) and the maximum size passed to the generators (modifyMaxSize) (and indeed internally they modify the Args passed to QuickCheck's driver). I believe their purpose is to modify values coming from outside the program, via the command line options --qc-max-success and --qc-max-size. You can certainly set them to constants: modifyMaxSuccess (const 1000) $ prop ... But to specify the domains of your properties from within the program, the approaches mentioned in the answer you linked to are still current. Defining a newtype wrapper with an Arbitrary instance is a somewhat heavyweight solution. Some already exist for common preconditions, for example you can use Positive instead of the first check in modfiz: modfiz :: Positive Int -> Bool modfiz (Positive int) = ... The answer also mentions forAll and standalone generators, which I find to be most straightforward to set the domain of testfib: testfib :: Property testfib = forAll (choose (1, 1000)) $ \n -> ... Li-yao From davidescobar at ieee.org Wed May 4 01:22:59 2016 From: davidescobar at ieee.org (David Escobar) Date: Tue, 3 May 2016 18:22:59 -0700 Subject: [Haskell-cafe] Amazon SES email issues In-Reply-To: References: <1c8ca976-d01b-94cd-adaf-b64c9bf35b77@gmail.com> Message-ID: Hi Imants. I thought about using a library in another language (since I know they work), but since I'm just writing a very small utility program, if I use another language for the email portion, I may as well write the whole utility in that language (which I actually did end up doing - in Rust). On Sat, Apr 30, 2016 at 1:54 AM, Imants Cekusins wrote: > are Amazon client API libraries (java, ...) - an option? > ? > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidescobar at ieee.org Wed May 4 01:29:08 2016 From: davidescobar at ieee.org (David Escobar) Date: Tue, 3 May 2016 18:29:08 -0700 Subject: [Haskell-cafe] Amazon SES email issues In-Reply-To: References: Message-ID: Hi Vlatko, just wanted to get back to you on this. It looks like we're using EC2 instances, but after looking at the SES section, it doesn't seem to be tied to any specific instance (not sure if and how that's different from the E2 instances you're using). I also used the Amazon verified email address in the system as the 'From' address, but unfortunately, it still didn't work. The keys are correct too. For now, I just ended up going with my Rust solution since it was such a small utility app anyway, but it would be interesting to see if other people run into similar issues in the future. Thanks. On Sat, Apr 30, 2016 at 12:39 AM, Vlatko Basic wrote: > Hi David, > > I'm using almost exact function as you wrote below and it works without > problems. Using mime-mail-ses-0.3.2.2. > > However, it works on E2 instance. Don't know if that matters. > > Stupid question, but have you double checked keys? > > I received similar errors when keys were not correct (they were not > hardcoded, but fetched). > > > br, > > vlatko > > -------- Original Message -------- > Subject: Re: [Haskell-cafe] Amazon SES email issues > From: David Escobar > To: David Johnson > Cc: Haskell Cafe > Date: 30/04/16 09:10 > > > David, thanks for the suggestion. Are there any examples on how to send an > email? I've looked through several of the Haskell email packages and have > been able to figure out their APIs easily enough, but this one seems > incredibly complex - almost seem to have to know the internals of SES to > use it effectively and the documentation / examples are scant. > > On Fri, Apr 29, 2016 at 7:07 AM, David Johnson > wrote: > >> I think that package is using an outdated version of the AWS Signing >> algorithm. >> >> "AWS3-HTTPS" >> I think AWS is migrating most of their APIs (who have domains / services created after a certain date) to require using the V4 Signature algorithm for all API requests. >> >> The amazonka-ses would probably work better. >> >> >> On Fri, Apr 29, 2016 at 1:45 AM, David Escobar < >> davidescobar at ieee.org> wrote: >> >>> Hi everyone, >>> I'm having issues with sending email through Amazon SES. I'm using the >>> *Network.Mail.Mime.SES* package. The error I get is: >>> >>> *email-test-exe: SESException {seStatus = Status {statusCode = 403, >>> statusMessage = "Forbidden"}, seCode = "SignatureDoesNotMatch", seMessage = >>> "The request signature we calculated does not match the signature you >>> provided. Check your AWS Secret Access Key and signing method. Consult the >>> service documentation for details.", seRequestId = >>> "8ceb250a-0dd3-11e6-892c-4fb1a14d4732"}* >>> >>> What's confusing is that I'm using the same SES settings in a Rails app >>> as well as a small Rust console program without any issues (it works from >>> the same machine too). The only thing I can think of is that with this >>> Haskell package, I haven't found where to set certain things like the port >>> number (587) and so maybe it's that? Here is a small sample app that >>> illustrates the problem. What am I missing? Thanks. >>> >>> >>> >>> *{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-}* >>> *module Main where* >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> * import Data.Function ((&)) import GHC.Generics import >>> Network.HTTP.Client import Network.HTTP.Client.TLS import Network.Mail.Mime >>> import Network.Mail.Mime.SES import Text.Hamlet (shamlet) import >>> Text.Blaze.Html.Renderer.String (renderHtml) import qualified >>> Data.ByteString.Char8 as C8 import qualified Data.Text as T import >>> qualified Data.Text.Lazy as LT main :: IO () main = do manager <- >>> newManager tlsManagerSettings let sesConfig = SES { sesFrom = C8.pack >>> "de at somewhere.com ", sesTo = [ >>> C8.pack "someone.else at somewhereelse.com " >>> ], sesAccessKey = "SOMEAWSACCESSKEY", >>> sesSecretKey = "ANEVENLONGERAWSSECRETKEY1234567890", >>> sesRegion = usEast1 } email = Mail { mailFrom = Address >>> (Just "David Escobar") " de at somewhere.com >>> ", mailTo = [ Address (Just "Someone >>> Else") " someone.else at somewhereelse.com >>> " ], mailParts = [ [ >>> htmlPart testEmail ] ], mailCc = [], >>> mailBcc = [], mailHeaders = [ ("subject", "Some >>> Test Email"), ("Content-Type", >>> "text/html; charset=ISO-8859-1") ] } renderSendMailSES manager sesConfig >>> email testEmail :: LT.Text testEmail = let rows = [ [ "1", "2", "3" ], [ >>> "4", "5", "6" ]] in renderHtml [shamlet| $doctype 5 >>> >>> >> style="background-color: #f8f9ee;">
Column 1 Column 2 >> style="background-color: #072a2d; color: white; font-weight: bold; >>> border-right: 1px solid white; padding: 5px 10px; width: 33%;"> >>> Column 3 $forall row <- rows
>>> #{T.pack $ row !! 0} >>> #{T.pack $ row !! 1} >>> #{T.pack $ row !! 2} |] & LT.pack* >>> >>> >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >>> >>> >> >> >> -- >> Cell: 1.630.740.8204 >> > > > > _______________________________________________ > Haskell-Cafe mailing listHaskell-Cafe at haskell.orghttp://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From brucker at spamfence.net Wed May 4 02:10:21 2016 From: brucker at spamfence.net (Achim D. Brucker) Date: Wed, 4 May 2016 03:10:21 +0100 Subject: [Haskell-cafe] Call for Papers: OCL and Textual Modeling Tools and Textual Model Transformations (OCL 2016) - Submit Your Paper Until July 17, 2016 Message-ID: <20160504021021.GA9007@fujikawa.home.brucker.ch> (Apologies for duplicates) CALL FOR PAPERS 16th International Workshop on OCL and Textual Modeling Co-located with ACM/IEEE 19th International Conference on Model Driven Engineering Languages and Systems (MODELS 2016) October 2-4, 2016, Saint-Malo, France (TBC) http://oclworkshop.github.io Modeling started out with UML and its precursors as a graphical notation. Such visual representations enable direct intuitive capturing of reality, but some of their features are difficult to formalize and lack the level of precision required to create complete and unambiguous specifications. Limitations of the graphical notations encouraged the development of text-based modeling languages that either integrate with or replace graphical notations for modeling. Typical examples of such languages are OCL, textual MOF, Epsilon, and Alloy. Textual modeling languages have their roots in formal language paradigms like logic, programming and databases. The goal of this workshop is to create a forum where researchers and practitioners interested in building models using OCL or other kinds of textual languages can directly interact, report advances, share results, identify tools for language development, and discuss appropriate standards. In particular, the workshop will encourage discussions for achieving synergy from different modeling language concepts and modeling language use. The close interaction will enable researchers and practitioners to identify common interests and options for potential cooperation. Topics of interest include (but are not limited to) =================================================== - Mappings between textual modeling languages and other languages or formalisms - Algorithms, evaluation strategies and optimizations in the context of textual modeling languages for -- validation, verification, and testing, -- model transformation and code generation, -- meta-modeling and DSLs, and -- query and constraint specifications - Alternative graphical/textual notations for textual modeling languages - Evolution, transformation and simplification of textual modeling expressions - Libraries, templates and patterns for textual modeling languages - Tools that support textual modeling languages (e.g., verification of OCL formulae, runtime monitoring of invariants) - Complexity results for textual modeling languages - Quality models and benchmarks for comparing and evaluating textual modeling tools and algorithms - Successful applications of textual modeling languages - Case studies on industrial applications of textual modeling languages - Experience reports -- usage of textual modeling languages and tools in complex domains, -- usability of textual modeling languages and tools for end-users - Empirical studies about the benefits and drawbacks of textual modeling languages - Innovative textual modeling tools - Comparison, evaluation and integration of modeling languages - Correlation between modeling languages and modeling tasks This year, we particularly encourage submissions describing tools that support - in a very broad sense - textual modeling languages (if you have implemented OCL.js to run OCL in a web browser, this is the right workshop to present your work) as well as textual model transformations. Venue ===== The workshop will be organized as a part of MODELS 2016 Conference in Saint-Malo, France. It continues the series of OCL workshops held at UML/MODELS conferences: York (2000), Toronto (2001), San Francisco (2003), Lisbon (2004), Montego Bay (2005), Genova (2006), Nashville (2007), Toulouse (2008), Denver (2009), Oslo (2010), Zurich (2011, at the TOOLs conference), 2012 in Innsbruck, 2013 in Miami, 2014 in Valencia, Spain, and 2015 in Ottawa, Canada. Similar to its predecessors, the workshop addresses both people from academia and industry. The aim is to provide a forum for addressing integration of OCL and other textual modeling languages, as well as tools for textual modeling, and for disseminating good practice and discussing the new requirements for textual modeling. Workshop Format =============== The workshop will include short (about 15 min) presentations, parallel sessions of working groups, and sum-up discussions. Submissions =========== Two types of papers will be considered: * short contributions (between 6 and 8 pages) describing new ideas, innovative tools or position papers. * full papers (between 12 and 16 pages) in LNCS format. Submissions should be uploaded to EasyChair (https://easychair.org/conferences/?conf=ocl16). The program committee will review the submissions (minimum 2 reviews per paper, usually 3 reviews) and select papers according to their relevance and interest for discussions that will take place at the workshop. Accepted papers will be published online in a post-conference edition of CEUR (http://www.ceur-ws.org). Important Dates =============== Submission of papers: July 17, 2016 Notification: August 14, 2016 Workshop date: October 2-4, 2016 Organizers ========== Achim D. Brucker, The University of Sheffield, UK Jordi Cabot, ICREA - Open University of Catalonia, Spain Adolfo S?nchez-Barbudo Herrera, University of York, UK Programme Committee (TBC) ========================= Thomas Baar, University of Applied Sciences Berlin, Germany Mira Balaban, Ben-Gurion University of the Negev, Israel Tricia Balfe, Nomos Software, Ireland Domenico Bianculli, University of Luxembourg Dan Chiorean, Babes-Bolyai University, Romania Robert Clariso, Universitat Oberta de Catalunya, Spain Tony Clark, Middlesex University, UK Manuel Clavel, IMDEA Software Institute, Spain Birgit Demuth, Technische Universitat Dresden, Germany Marina Egea, Indra Sistemas S.A., Spain Geri Georg, Colorado State University, USA Martin Gogolla, University of Bremen, Germany Shahar Maoz, Tel Aviv University, Israel Istvan Rath, Budapest University of Technology and Economics, Hungary Bernhard Rumpe, RWTH Aachen, Germany Massimo Tisi, Mines de Nantes, France Frederic Tuong, Univ. Paris-Sud - IRT SystemX - LRI, France Edward Willink, Willink Transformations Ltd., UK Burkhart Wolff, Univ. Paris-Sud - LRI, France Steffen Zschaler, King's College, UK -- Dr. Achim D. Brucker | Senior Lecturer | University of Sheffield https://www.brucker.ch/ From carter.schonwald at gmail.com Wed May 4 04:09:24 2016 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Wed, 4 May 2016 00:09:24 -0400 Subject: [Haskell-cafe] ANN: monad-ste-0.1.0.0 Message-ID: hello All, I took the time this evening to clean up some work that came out of a larger project and have made a corresponding release to hackage monad-ste is sibling to ST that provides efficient abortive errors using GHC's exception machinery as well as handy machinery like being a PrimMonad and PrimBase instance! (and take heed, you cannot catch ) hackage: https://hackage.haskell.org/package/monad-ste-0.1.0.0 github: https://github.com/cartazio/monad-ste also thanks Brian Schroeder, Joel Burget and Duncan Coutts for providing invaluable feedback, debugging and the like for this library enjoy! -Carter -------------- next part -------------- An HTML attachment was scrubbed... URL: From manny at fpcomplete.com Wed May 4 10:47:20 2016 From: manny at fpcomplete.com (Emanuel Borsboom) Date: Wed, 04 May 2016 10:47:20 +0000 Subject: [Haskell-cafe] ANN: stack-1.1.0 Message-ID: See haskellstack.org for installation and upgrade instructions. Release notes: - Added Ubuntu 16.04 LTS (xenial) Apt repo. - No longer uploading new versions to Fedora 21 repo. Behavior changes: - Snapshot packages are no longer built with executable profiling. See #1179 . - stack init now ignores symlinks when searching for cabal files. It also now ignores any directory that begins with . (as well as dist dirs) - before it would only ignore .git, .stack-work, and dist. - The stack executable is no longer built with -rtsopts. Before, when -rtsopts was enabled, stack would process +RTS options even when intended for some other program, such as when used with stack exec -- prog +RTS. See #2022 . - The stack path --ghc-paths option is deprecated and renamed to --programs. --compiler is added, which points directly at the compiler used in the current project. --compiler-bin points to the compiler?s bin dir. - For consistency with the $STACK_ROOT environment variable, the stack path --global-stack-root flag and the global-stack-root field in the output of stack path are being deprecated and replaced with the stack-root flag and output field. Additionally, the stack root can now be specified via the --stack-root command-line flag. See #1148 . - stack sig GPG-related sub-commands were removed (folded into upload and sdist) - GPG signing of packages while uploading to Hackage is now the default. Use upload --no-signature if you would rather not contribute your package signature. If you don?t yet have a GPG keyset, read this blog post on GPG keys We can add a stack.yaml config setting to disable signing if some people desire it. We hope that people will sign. Later we will be adding GPG signature verification options. - stack build pkg-1.2.3 will now build even if the snapshot has a different package version - it is treated as an extra-dep. stack build local-pkg-1.2.3 is an error even if the version number matches the local package #2028 . - Having a nix: section no longer implies enabling nix build. This allows the user to globally configure whether nix is used (unless the project overrides the default explicitly). See #1924 . - Remove deprecated valid-wanted field. - Docker: mount home directory in container #1949 . - Deprecate --local-bin-path instead --local-bin. - stack image: allow absolute source paths for add. Other enhancements: - stack haddock --open [PACKAGE] opens the local haddocks in the browser. - Fix too much rebuilding when enabling/disabling profiling flags. - stack build pkg-1.0 will now build pkg-1.0 even if the snapshot specifies a different version (it introduces a temporary extra-dep) - Experimental support for --split-objs added #1284 . - git packages with submodules are supported by passing the --recursive flag to git clone. - When using hpack , only regenerate cabal files when hpack files change. - hpack files can now be used in templates - stack ghci now runs ghci as a separate process #1306 - Retry when downloading snapshots and package indices - Many build options are configurable now in stack.yaml: build: library-profiling: true executable-profiling: true haddock: true haddock-deps: true copy-bins: true prefetch: true force-dirty: true keep-going: true test: true test-arguments: rerun-tests: true additional-args: ['-fprof'] coverage: true no-run-tests: true bench: true benchmark-opts: benchmark-arguments: -O2 no-run-benchmarks: true reconfigure: true cabal-verbose: true - A number of URLs are now configurable, useful for firewalls. See #1794 . - Suggest causes when executables are missing. - Allow --omit-packages even without --solver. - Improve the generated stack.yaml. - Improve ghci results after :load Main module collision with main file path. - Only load the hackage index if necessary #1883 , #1892 . - init: allow local packages to be deps of deps #1965 . - Always use full fingerprints from GPG #1952 . - Default to using gpg2 and fall back to gpg #1976 . - Add a flag for ?verbosity silent. - Add haddock --open flag #1396 . Bug fixes: - Package tarballs would fail to unpack. #1884 . - Fixed errant warnings about missing modules, after deleted and removed from cabal file #921 #1805 . - Now considers a package to dirty when the hpack file is changed #1819 . - Nix: cancelling a stack build now exits properly rather than dropping into a nix-shell #1778 . - allow-newer: true now causes --exact-configuration to be passed to Cabal. See #1579 . - stack solver no longer fails with InvalidRelFile for relative package paths including ... See #1954 . - Ignore emacs lock files when finding .cabal #1897 . - Use lenient UTF-8 decode for build output #1945 . - Clear index cache whenever index updated #1962 . - Fix: Building a container image drops a .stack-work dir in the current working (sub)directory #1975 . - Fix: Rebuilding when disabling profiling #2023 . ------------------------------ Thanks to all our contributors for this release: - Beerend Lauwers @beerendlauwers - Chris Done @chrisdone - Christian Hoener zu Siederdissen - @CthulhuDen - Emanuel Borsboom @borsboom - Erik Stevenson @narrative - @fmap - Greg @myfreeweb - Harendra Kumar @harendra-kumar - Luigy Leon @luigy - @malteneuss - Mark Karpov @mrkkrp - Martin Dehnel-Wild @mpdehnel - Mathieu Boespflug @mboes - Michael Sloan @mgsloan - Michael Snoyman @snoyberg - Noon van der Silk @silky - Oleg Grenrus @phadej - Paul Rouse @paul-rouse - Rob Rix @robrix - Simon Hengel @sol - Simon Jakobi @sjakobi - Taylor Fausak @tfausak - @tejon - Tim Dysinger @dysinger - Tobias Kortkamp @t6 - Tristan Webb @drwebb - Yuji Yamamoto @igrep - Yuriy Syrovetskiy @cblp - Yves Par?s (Ywen) @YPares And thanks as always to the 150+ contributors to past releases! ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From tomas.carnecky at gmail.com Wed May 4 13:18:30 2016 From: tomas.carnecky at gmail.com (Tomas Carnecky) Date: Wed, 04 May 2016 13:18:30 +0000 Subject: [Haskell-cafe] ANN: stack-1.1.0 In-Reply-To: References: Message-ID: The blog post on GPG keys doesn't exist. On Wed, May 4, 2016 at 12:47 PM Emanuel Borsboom wrote: > See haskellstack.org for installation and upgrade instructions. > > Release notes: > > - Added Ubuntu 16.04 LTS (xenial) Apt repo. > - No longer uploading new versions to Fedora 21 repo. > > Behavior changes: > > - Snapshot packages are no longer built with executable profiling. See > #1179 . > - stack init now ignores symlinks when searching for cabal files. It > also now ignores any directory that begins with . (as well as dist > dirs) - before it would only ignore .git, .stack-work, and dist. > - The stack executable is no longer built with -rtsopts. Before, when > -rtsopts was enabled, stack would process +RTS options even when > intended for some other program, such as when used with stack exec -- > prog +RTS. See #2022 > . > - The stack path --ghc-paths option is deprecated and renamed to > --programs. --compiler is added, which points directly at the compiler > used in the current project. --compiler-bin points to the compiler?s > bin dir. > - For consistency with the $STACK_ROOT environment variable, the stack > path --global-stack-root flag and the global-stack-root field in the > output of stack path are being deprecated and replaced with the > stack-root flag and output field. Additionally, the stack root can now > be specified via the --stack-root command-line flag. See #1148 > . > - stack sig GPG-related sub-commands were removed (folded into upload > and sdist) > - GPG signing of packages while uploading to Hackage is now the > default. Use upload --no-signature if you would rather not contribute > your package signature. If you don?t yet have a GPG keyset, read this blog > post on GPG keys > We can > add a stack.yaml config setting to disable signing if some people desire > it. We hope that people will sign. Later we will be adding GPG signature > verification options. > - stack build pkg-1.2.3 will now build even if the snapshot has a > different package version - it is treated as an extra-dep. stack build > local-pkg-1.2.3 is an error even if the version number matches the > local package #2028 > . > - Having a nix: section no longer implies enabling nix build. This > allows the user to globally configure whether nix is used (unless the > project overrides the default explicitly). See #1924 > . > - Remove deprecated valid-wanted field. > - Docker: mount home directory in container #1949 > . > - Deprecate --local-bin-path instead --local-bin. > - stack image: allow absolute source paths for add. > > Other enhancements: > > - stack haddock --open [PACKAGE] opens the local haddocks in the > browser. > - Fix too much rebuilding when enabling/disabling profiling flags. > - stack build pkg-1.0 will now build pkg-1.0 even if the snapshot > specifies a different version (it introduces a temporary extra-dep) > - Experimental support for --split-objs added #1284 > . > - git packages with submodules are supported by passing the --recursive > flag to git clone. > - When using hpack , only regenerate > cabal files when hpack files change. > - hpack files can now be used in templates > - stack ghci now runs ghci as a separate process #1306 > > - Retry when downloading snapshots and package indices > - Many build options are configurable now in stack.yaml: > > build: > library-profiling: true > executable-profiling: true > haddock: true > haddock-deps: true > copy-bins: true > prefetch: true > force-dirty: true > keep-going: true > test: true > test-arguments: > rerun-tests: true > additional-args: ['-fprof'] > coverage: true > no-run-tests: true > bench: true > benchmark-opts: > benchmark-arguments: -O2 > no-run-benchmarks: true > reconfigure: true > cabal-verbose: true > > - A number of URLs are now configurable, useful for firewalls. See > #1794 . > - Suggest causes when executables are missing. > - Allow --omit-packages even without --solver. > - Improve the generated stack.yaml. > - Improve ghci results after :load Main module collision with main > file path. > - Only load the hackage index if necessary #1883 > , #1892 > . > - init: allow local packages to be deps of deps #1965 > . > - Always use full fingerprints from GPG #1952 > . > - Default to using gpg2 and fall back to gpg #1976 > . > - Add a flag for ?verbosity silent. > - Add haddock --open flag #1396 > . > > Bug fixes: > > - Package tarballs would fail to unpack. #1884 > . > - Fixed errant warnings about missing modules, after deleted and > removed from cabal file #921 > #1805 > . > - Now considers a package to dirty when the hpack file is changed #1819 > . > - Nix: cancelling a stack build now exits properly rather than > dropping into a nix-shell #1778 > . > - allow-newer: true now causes --exact-configuration to be passed to > Cabal. See #1579 > . > - stack solver no longer fails with InvalidRelFile for relative > package paths including ... See #1954 > . > - Ignore emacs lock files when finding .cabal #1897 > . > - Use lenient UTF-8 decode for build output #1945 > . > - Clear index cache whenever index updated #1962 > . > - Fix: Building a container image drops a .stack-work dir in the > current working (sub)directory #1975 > . > - Fix: Rebuilding when disabling profiling #2023 > . > > ------------------------------ > > Thanks to all our contributors for this release: > > - Beerend Lauwers @beerendlauwers > - Chris Done @chrisdone > - Christian Hoener zu Siederdissen > - @CthulhuDen > - Emanuel Borsboom @borsboom > - Erik Stevenson @narrative > - @fmap > - Greg @myfreeweb > - Harendra Kumar @harendra-kumar > - Luigy Leon @luigy > - @malteneuss > - Mark Karpov @mrkkrp > - Martin Dehnel-Wild @mpdehnel > - Mathieu Boespflug @mboes > - Michael Sloan @mgsloan > - Michael Snoyman @snoyberg > - Noon van der Silk @silky > - Oleg Grenrus @phadej > - Paul Rouse @paul-rouse > - Rob Rix @robrix > - Simon Hengel @sol > - Simon Jakobi @sjakobi > - Taylor Fausak @tfausak > - @tejon > - Tim Dysinger @dysinger > - Tobias Kortkamp @t6 > - Tristan Webb @drwebb > - Yuji Yamamoto @igrep > - Yuriy Syrovetskiy @cblp > - Yves Par?s (Ywen) @YPares > > And thanks as always to the 150+ contributors to past releases! > ? > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at schmong.org Wed May 4 23:18:23 2016 From: michael at schmong.org (Michael Litchard) Date: Wed, 4 May 2016 16:18:23 -0700 Subject: [Haskell-cafe] Cabal confusion. Modules not being exposed still accessible for testing. Message-ID: I use reactive-banana as an example. My question is how can Reactive.Banana.Internal.Combinators be testable from Reactive.Banana.Test.Plumbing? My misunderstanding is that only modules named in the exposed-modules stanza could be imported. Could someone clear up my misunderstanding? -------------- next part -------------- An HTML attachment was scrubbed... URL: From acowley at seas.upenn.edu Wed May 4 23:24:38 2016 From: acowley at seas.upenn.edu (Anthony Cowley) Date: Wed, 04 May 2016 19:24:38 -0400 Subject: [Haskell-cafe] Cabal confusion. Modules not being exposed still accessible for testing. In-Reply-To: References: Message-ID: Michael Litchard writes: > I use reactive-banana > > as an example. > > My question is how can Reactive.Banana.Internal.Combinators be testable > from Reactive.Banana.Test.Plumbing? My misunderstanding is that only > modules named in the exposed-modules stanza could be imported. Could > someone clear up my misunderstanding? The shared "hs-source-dirs" means the test suite is re-compiling the file from source, not depending on the library. Anthony From michael at schmong.org Wed May 4 23:29:00 2016 From: michael at schmong.org (Michael Litchard) Date: Wed, 4 May 2016 16:29:00 -0700 Subject: [Haskell-cafe] Cabal confusion. Modules not being exposed still accessible for testing. In-Reply-To: References: Message-ID: Ah thanks! On Wed, May 4, 2016 at 4:24 PM, Anthony Cowley wrote: > > Michael Litchard writes: > > > I use reactive-banana > > < > https://github.com/HeinrichApfelmus/reactive-banana/blob/master/reactive-banana/reactive-banana.cabal > > > > as an example. > > > > My question is how can Reactive.Banana.Internal.Combinators be testable > > from Reactive.Banana.Test.Plumbing? My misunderstanding is that only > > modules named in the exposed-modules stanza could be imported. Could > > someone clear up my misunderstanding? > > The shared "hs-source-dirs" means the test suite is re-compiling the file > from source, not depending on the library. > > Anthony > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jake.waksbaum at gmail.com Thu May 5 01:05:37 2016 From: jake.waksbaum at gmail.com (Jake) Date: Thu, 05 May 2016 01:05:37 +0000 Subject: [Haskell-cafe] Is Haskell IO inherently slower than C? Message-ID: I'm trying to write a program in Haskell that writes a large file at the end, and it seems like that output alone is taking way longer than it should. I don't understand why Haskell shouldn't be able to write data as quickly as C, so I wrote two test files: -- Test.hs import Control.Loop import Data.ByteString.Builder import System.IO main :: IO () main = numLoop 0 1000000 $ \_ -> hPutBuilder stdout $ char7 ' ' // test.c #include int main() { int i; for (i = 0; i < 1000000; i++) { fprintf(stdout, " "); } return 0; } I compiled them both with -O2, and ran them redirecting their outputs to /dev/null. For the Haskell version I got times aroudn 0.3 seconds, while the C version was around 0.03. Is there any reason why in simple IO the Haskell version would be slower by an order of magnitude? -------------- next part -------------- An HTML attachment was scrubbed... URL: From jake.waksbaum at gmail.com Thu May 5 01:07:25 2016 From: jake.waksbaum at gmail.com (Jake) Date: Thu, 05 May 2016 01:07:25 +0000 Subject: [Haskell-cafe] Is Haskell IO inherently slower than C? In-Reply-To: References: Message-ID: I also tried the more standard forM_ [0..100000] idiom and got similar times. I hoped loop might be faster, but apparently not. On Wed, May 4, 2016 at 9:05 PM Jake wrote: > I'm trying to write a program in Haskell that writes a large file at the > end, and it seems like that output alone is taking way longer than it > should. I don't understand why Haskell shouldn't be able to write data as > quickly as C, so I wrote two test files: > > -- Test.hs > import Control.Loop > import Data.ByteString.Builder > import System.IO > > main :: IO () > main = > numLoop 0 1000000 $ \_ -> > hPutBuilder stdout $ char7 ' ' > > // test.c > #include > > int main() { > int i; > for (i = 0; i < 1000000; i++) { > fprintf(stdout, " "); > } > return 0; > } > > I compiled them both with -O2, and ran them redirecting their outputs to > /dev/null. For the Haskell version I got times aroudn 0.3 seconds, while > the C version was around 0.03. Is there any reason why in simple IO the > Haskell version would be slower by an order of magnitude? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mike at izbicki.me Thu May 5 01:18:15 2016 From: mike at izbicki.me (Mike Izbicki) Date: Wed, 4 May 2016 18:18:15 -0700 Subject: [Haskell-cafe] Is Haskell IO inherently slower than C? In-Reply-To: References: Message-ID: You need to be doing tests that take much longer to accurately compare runtimes of executables. Here's why: Haskell programs have a more complicated run time system than C programs, and the binaries output by GHC are much larger. Therefore, there will be a small additional overhead that you have to pay once when the program starts. For some machines, this could possibly be on the order of 0.3 seconds. I'd recommend you scale your test so that it takes at least 30 seconds for the slowest program. This will give you more meaningful results. On Wed, May 4, 2016 at 6:07 PM, Jake wrote: > I also tried the more standard forM_ [0..100000] idiom and got similar > times. I hoped loop might be faster, but apparently not. > > On Wed, May 4, 2016 at 9:05 PM Jake wrote: >> >> I'm trying to write a program in Haskell that writes a large file at the >> end, and it seems like that output alone is taking way longer than it >> should. I don't understand why Haskell shouldn't be able to write data as >> quickly as C, so I wrote two test files: >> >> -- Test.hs >> import Control.Loop >> import Data.ByteString.Builder >> import System.IO >> >> main :: IO () >> main = >> numLoop 0 1000000 $ \_ -> >> hPutBuilder stdout $ char7 ' ' >> >> // test.c >> #include >> >> int main() { >> int i; >> for (i = 0; i < 1000000; i++) { >> fprintf(stdout, " "); >> } >> return 0; >> } >> >> I compiled them both with -O2, and ran them redirecting their outputs to >> /dev/null. For the Haskell version I got times aroudn 0.3 seconds, while the >> C version was around 0.03. Is there any reason why in simple IO the Haskell >> version would be slower by an order of magnitude? > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > From jake.waksbaum at gmail.com Thu May 5 01:22:26 2016 From: jake.waksbaum at gmail.com (Jake) Date: Thu, 05 May 2016 01:22:26 +0000 Subject: [Haskell-cafe] Is Haskell IO inherently slower than C? In-Reply-To: References: Message-ID: Thanks for the tip! I tried it again, this time using 100000000, and the Haskell one runs at around 25 seconds. The C one is only 1.5 seconds. Can that still be the run time system? On Wed, May 4, 2016 at 9:18 PM Mike Izbicki wrote: > You need to be doing tests that take much longer to accurately compare > runtimes of executables. Here's why: > > Haskell programs have a more complicated run time system than C > programs, and the binaries output by GHC are much larger. Therefore, > there will be a small additional overhead that you have to pay once > when the program starts. For some machines, this could possibly be on > the order of 0.3 seconds. > > I'd recommend you scale your test so that it takes at least 30 seconds > for the slowest program. This will give you more meaningful results. > > On Wed, May 4, 2016 at 6:07 PM, Jake wrote: > > I also tried the more standard forM_ [0..100000] idiom and got similar > > times. I hoped loop might be faster, but apparently not. > > > > On Wed, May 4, 2016 at 9:05 PM Jake wrote: > >> > >> I'm trying to write a program in Haskell that writes a large file at the > >> end, and it seems like that output alone is taking way longer than it > >> should. I don't understand why Haskell shouldn't be able to write data > as > >> quickly as C, so I wrote two test files: > >> > >> -- Test.hs > >> import Control.Loop > >> import Data.ByteString.Builder > >> import System.IO > >> > >> main :: IO () > >> main = > >> numLoop 0 1000000 $ \_ -> > >> hPutBuilder stdout $ char7 ' ' > >> > >> // test.c > >> #include > >> > >> int main() { > >> int i; > >> for (i = 0; i < 1000000; i++) { > >> fprintf(stdout, " "); > >> } > >> return 0; > >> } > >> > >> I compiled them both with -O2, and ran them redirecting their outputs to > >> /dev/null. For the Haskell version I got times aroudn 0.3 seconds, > while the > >> C version was around 0.03. Is there any reason why in simple IO the > Haskell > >> version would be slower by an order of magnitude? > > > > > > _______________________________________________ > > Haskell-Cafe mailing list > > Haskell-Cafe at haskell.org > > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mike at izbicki.me Thu May 5 01:44:59 2016 From: mike at izbicki.me (Mike Izbicki) Date: Wed, 4 May 2016 18:44:59 -0700 Subject: [Haskell-cafe] Is Haskell IO inherently slower than C? In-Reply-To: References: Message-ID: That convinces me that your Haskell program is actually slower. My guess is this is due to a buffering issue, and not due to anything haskell related. Buffering is how the opeating system makes a tradeoff between performance and safety for io operations, and I'm guessing your two code fragments are (behind the scenes) making a different decision about how to do buffering. For a Haskell-related discussion about buffering, see: http://book.realworldhaskell.org/read/io.html#io.buffering BTW, a good rule of thumb for io performance in any language is to never write anything character by character, and instead write large chunks of characters at once. The above link should make clear why this is the case. On Wed, May 4, 2016 at 6:22 PM, Jake wrote: > Thanks for the tip! I tried it again, this time using 100000000, and the > Haskell one runs at around 25 seconds. The C one is only 1.5 seconds. Can > that still be the run time system? > > On Wed, May 4, 2016 at 9:18 PM Mike Izbicki wrote: >> >> You need to be doing tests that take much longer to accurately compare >> runtimes of executables. Here's why: >> >> Haskell programs have a more complicated run time system than C >> programs, and the binaries output by GHC are much larger. Therefore, >> there will be a small additional overhead that you have to pay once >> when the program starts. For some machines, this could possibly be on >> the order of 0.3 seconds. >> >> I'd recommend you scale your test so that it takes at least 30 seconds >> for the slowest program. This will give you more meaningful results. >> >> On Wed, May 4, 2016 at 6:07 PM, Jake wrote: >> > I also tried the more standard forM_ [0..100000] idiom and got similar >> > times. I hoped loop might be faster, but apparently not. >> > >> > On Wed, May 4, 2016 at 9:05 PM Jake wrote: >> >> >> >> I'm trying to write a program in Haskell that writes a large file at >> >> the >> >> end, and it seems like that output alone is taking way longer than it >> >> should. I don't understand why Haskell shouldn't be able to write data >> >> as >> >> quickly as C, so I wrote two test files: >> >> >> >> -- Test.hs >> >> import Control.Loop >> >> import Data.ByteString.Builder >> >> import System.IO >> >> >> >> main :: IO () >> >> main = >> >> numLoop 0 1000000 $ \_ -> >> >> hPutBuilder stdout $ char7 ' ' >> >> >> >> // test.c >> >> #include >> >> >> >> int main() { >> >> int i; >> >> for (i = 0; i < 1000000; i++) { >> >> fprintf(stdout, " "); >> >> } >> >> return 0; >> >> } >> >> >> >> I compiled them both with -O2, and ran them redirecting their outputs >> >> to >> >> /dev/null. For the Haskell version I got times aroudn 0.3 seconds, >> >> while the >> >> C version was around 0.03. Is there any reason why in simple IO the >> >> Haskell >> >> version would be slower by an order of magnitude? >> > >> > >> > _______________________________________________ >> > Haskell-Cafe mailing list >> > Haskell-Cafe at haskell.org >> > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >> > From jake.waksbaum at gmail.com Thu May 5 02:06:09 2016 From: jake.waksbaum at gmail.com (Jake) Date: Thu, 05 May 2016 02:06:09 +0000 Subject: [Haskell-cafe] Is Haskell IO inherently slower than C? In-Reply-To: References: Message-ID: It seems to me that BlockBuffering is the fastest. I checked and the default buffering mode for stdout is BlockBuffering Nothing. So I went to the C program and checked the value of BUFSIZ which was 8192. Then I set the buffering mode for stdout to BlockBuffering (Just 8192) so they should be buffering the same, right? It didn't really change the performance at all. Is there something else going on with the buffering I'm not changing? On Wed, May 4, 2016 at 9:45 PM Mike Izbicki wrote: > That convinces me that your Haskell program is actually slower. My > guess is this is due to a buffering issue, and not due to anything > haskell related. Buffering is how the opeating system makes a > tradeoff between performance and safety for io operations, and I'm > guessing your two code fragments are (behind the scenes) making a > different decision about how to do buffering. > > For a Haskell-related discussion about buffering, see: > http://book.realworldhaskell.org/read/io.html#io.buffering > > BTW, a good rule of thumb for io performance in any language is to > never write anything character by character, and instead write large > chunks of characters at once. The above link should make clear why > this is the case. > > On Wed, May 4, 2016 at 6:22 PM, Jake wrote: > > Thanks for the tip! I tried it again, this time using 100000000, and the > > Haskell one runs at around 25 seconds. The C one is only 1.5 seconds. Can > > that still be the run time system? > > > > On Wed, May 4, 2016 at 9:18 PM Mike Izbicki wrote: > >> > >> You need to be doing tests that take much longer to accurately compare > >> runtimes of executables. Here's why: > >> > >> Haskell programs have a more complicated run time system than C > >> programs, and the binaries output by GHC are much larger. Therefore, > >> there will be a small additional overhead that you have to pay once > >> when the program starts. For some machines, this could possibly be on > >> the order of 0.3 seconds. > >> > >> I'd recommend you scale your test so that it takes at least 30 seconds > >> for the slowest program. This will give you more meaningful results. > >> > >> On Wed, May 4, 2016 at 6:07 PM, Jake wrote: > >> > I also tried the more standard forM_ [0..100000] idiom and got similar > >> > times. I hoped loop might be faster, but apparently not. > >> > > >> > On Wed, May 4, 2016 at 9:05 PM Jake wrote: > >> >> > >> >> I'm trying to write a program in Haskell that writes a large file at > >> >> the > >> >> end, and it seems like that output alone is taking way longer than it > >> >> should. I don't understand why Haskell shouldn't be able to write > data > >> >> as > >> >> quickly as C, so I wrote two test files: > >> >> > >> >> -- Test.hs > >> >> import Control.Loop > >> >> import Data.ByteString.Builder > >> >> import System.IO > >> >> > >> >> main :: IO () > >> >> main = > >> >> numLoop 0 1000000 $ \_ -> > >> >> hPutBuilder stdout $ char7 ' ' > >> >> > >> >> // test.c > >> >> #include > >> >> > >> >> int main() { > >> >> int i; > >> >> for (i = 0; i < 1000000; i++) { > >> >> fprintf(stdout, " "); > >> >> } > >> >> return 0; > >> >> } > >> >> > >> >> I compiled them both with -O2, and ran them redirecting their outputs > >> >> to > >> >> /dev/null. For the Haskell version I got times aroudn 0.3 seconds, > >> >> while the > >> >> C version was around 0.03. Is there any reason why in simple IO the > >> >> Haskell > >> >> version would be slower by an order of magnitude? > >> > > >> > > >> > _______________________________________________ > >> > Haskell-Cafe mailing list > >> > Haskell-Cafe at haskell.org > >> > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From duncan.coutts at googlemail.com Thu May 5 02:14:57 2016 From: duncan.coutts at googlemail.com (Duncan Coutts) Date: Thu, 05 May 2016 03:14:57 +0100 Subject: [Haskell-cafe] Is Haskell IO inherently slower than C? In-Reply-To: References: Message-ID: <1462414497.30003.31.camel@googlemail.com> On Thu, 2016-05-05 at 01:05 +0000, Jake wrote: > I'm trying to write a program in Haskell that writes a large file at > the > end, and it seems like that output alone is taking way longer than it > should. I don't understand why Haskell shouldn't be able to write > data as > quickly as C, so I wrote two test files: > > -- Test.hs > import Control.Loop > import Data.ByteString.Builder > import System.IO > > main :: IO () > main = > ? numLoop 0 1000000 $ \_ -> > ????hPutBuilder stdout $ char7 ' ' This is a highly pessimal?use of bytestring builder. You're setting up a new output buffer for every char. You should either write chars to the handle buffer, or write one big builder to the handle. That is either: numLoop 0 1000000 $ \_ -> ? hPutChar stdout ' ' or hPutBuilder stdout (mconcat (replicate 1000000 (char7 ' '))) This isn't the fastest way to use the ?bytestring builder, but it's pretty convenient. The first way isn't great as it has to take the Handle lock for every char. On my system those three versions run in time ranges of: ? Hs putChar: 0.154s -- 0.167s ? Hs builder: 0.008s -- 0.014s ? C: ? ? ? ? ?0.012s -- 0.023s So the answer is no. So long as you can blat bytes into a buffer quickly enough then there's no reason Haskell IO need be slower than C. In terms of benchmarking fairness, neither of these examples (the builder nor the C version) are the fastest possible ways of blatting bytes into buffers, though they're both reasonably convenient methods in both languages. Duncan From hyangfji at gmail.com Thu May 5 02:20:52 2016 From: hyangfji at gmail.com (Hong Yang) Date: Wed, 4 May 2016 21:20:52 -0500 Subject: [Haskell-cafe] Is Haskell IO inherently slower than C? In-Reply-To: References: Message-ID: I never used Data.ByteString.Builder before. But I guess "char7" is encoding a space to something. Will this slow things down? On Wed, May 4, 2016 at 8:44 PM, Mike Izbicki wrote: > That convinces me that your Haskell program is actually slower. My > guess is this is due to a buffering issue, and not due to anything > haskell related. Buffering is how the opeating system makes a > tradeoff between performance and safety for io operations, and I'm > guessing your two code fragments are (behind the scenes) making a > different decision about how to do buffering. > > For a Haskell-related discussion about buffering, see: > http://book.realworldhaskell.org/read/io.html#io.buffering > > BTW, a good rule of thumb for io performance in any language is to > never write anything character by character, and instead write large > chunks of characters at once. The above link should make clear why > this is the case. > > On Wed, May 4, 2016 at 6:22 PM, Jake wrote: > > Thanks for the tip! I tried it again, this time using 100000000, and the > > Haskell one runs at around 25 seconds. The C one is only 1.5 seconds. Can > > that still be the run time system? > > > > On Wed, May 4, 2016 at 9:18 PM Mike Izbicki wrote: > >> > >> You need to be doing tests that take much longer to accurately compare > >> runtimes of executables. Here's why: > >> > >> Haskell programs have a more complicated run time system than C > >> programs, and the binaries output by GHC are much larger. Therefore, > >> there will be a small additional overhead that you have to pay once > >> when the program starts. For some machines, this could possibly be on > >> the order of 0.3 seconds. > >> > >> I'd recommend you scale your test so that it takes at least 30 seconds > >> for the slowest program. This will give you more meaningful results. > >> > >> On Wed, May 4, 2016 at 6:07 PM, Jake wrote: > >> > I also tried the more standard forM_ [0..100000] idiom and got similar > >> > times. I hoped loop might be faster, but apparently not. > >> > > >> > On Wed, May 4, 2016 at 9:05 PM Jake wrote: > >> >> > >> >> I'm trying to write a program in Haskell that writes a large file at > >> >> the > >> >> end, and it seems like that output alone is taking way longer than it > >> >> should. I don't understand why Haskell shouldn't be able to write > data > >> >> as > >> >> quickly as C, so I wrote two test files: > >> >> > >> >> -- Test.hs > >> >> import Control.Loop > >> >> import Data.ByteString.Builder > >> >> import System.IO > >> >> > >> >> main :: IO () > >> >> main = > >> >> numLoop 0 1000000 $ \_ -> > >> >> hPutBuilder stdout $ char7 ' ' > >> >> > >> >> // test.c > >> >> #include > >> >> > >> >> int main() { > >> >> int i; > >> >> for (i = 0; i < 1000000; i++) { > >> >> fprintf(stdout, " "); > >> >> } > >> >> return 0; > >> >> } > >> >> > >> >> I compiled them both with -O2, and ran them redirecting their outputs > >> >> to > >> >> /dev/null. For the Haskell version I got times aroudn 0.3 seconds, > >> >> while the > >> >> C version was around 0.03. Is there any reason why in simple IO the > >> >> Haskell > >> >> version would be slower by an order of magnitude? > >> > > >> > > >> > _______________________________________________ > >> > Haskell-Cafe mailing list > >> > Haskell-Cafe at haskell.org > >> > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > >> > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wangbj at gmail.com Thu May 5 02:25:22 2016 From: wangbj at gmail.com (Baojun Wang) Date: Thu, 05 May 2016 02:25:22 +0000 Subject: [Haskell-cafe] Is Haskell IO inherently slower than C? In-Reply-To: References: Message-ID: ByteString Builder is supposed to build bytestring incrementally (as monoid), in the example it prints the builder immediately after build a single ``char7'', thus not necessary to use bytestring builder at all (which introduces overhead). On Wed, May 4, 2016 at 7:21 PM Hong Yang wrote: > I never used Data.ByteString.Builder before. But I guess "char7" is > encoding a space to something. Will this slow things down? > > On Wed, May 4, 2016 at 8:44 PM, Mike Izbicki wrote: > >> That convinces me that your Haskell program is actually slower. My >> guess is this is due to a buffering issue, and not due to anything >> haskell related. Buffering is how the opeating system makes a >> tradeoff between performance and safety for io operations, and I'm >> guessing your two code fragments are (behind the scenes) making a >> different decision about how to do buffering. >> >> For a Haskell-related discussion about buffering, see: >> http://book.realworldhaskell.org/read/io.html#io.buffering >> >> BTW, a good rule of thumb for io performance in any language is to >> never write anything character by character, and instead write large >> chunks of characters at once. The above link should make clear why >> this is the case. >> >> On Wed, May 4, 2016 at 6:22 PM, Jake wrote: >> > Thanks for the tip! I tried it again, this time using 100000000, and the >> > Haskell one runs at around 25 seconds. The C one is only 1.5 seconds. >> Can >> > that still be the run time system? >> > >> > On Wed, May 4, 2016 at 9:18 PM Mike Izbicki wrote: >> >> >> >> You need to be doing tests that take much longer to accurately compare >> >> runtimes of executables. Here's why: >> >> >> >> Haskell programs have a more complicated run time system than C >> >> programs, and the binaries output by GHC are much larger. Therefore, >> >> there will be a small additional overhead that you have to pay once >> >> when the program starts. For some machines, this could possibly be on >> >> the order of 0.3 seconds. >> >> >> >> I'd recommend you scale your test so that it takes at least 30 seconds >> >> for the slowest program. This will give you more meaningful results. >> >> >> >> On Wed, May 4, 2016 at 6:07 PM, Jake wrote: >> >> > I also tried the more standard forM_ [0..100000] idiom and got >> similar >> >> > times. I hoped loop might be faster, but apparently not. >> >> > >> >> > On Wed, May 4, 2016 at 9:05 PM Jake wrote: >> >> >> >> >> >> I'm trying to write a program in Haskell that writes a large file at >> >> >> the >> >> >> end, and it seems like that output alone is taking way longer than >> it >> >> >> should. I don't understand why Haskell shouldn't be able to write >> data >> >> >> as >> >> >> quickly as C, so I wrote two test files: >> >> >> >> >> >> -- Test.hs >> >> >> import Control.Loop >> >> >> import Data.ByteString.Builder >> >> >> import System.IO >> >> >> >> >> >> main :: IO () >> >> >> main = >> >> >> numLoop 0 1000000 $ \_ -> >> >> >> hPutBuilder stdout $ char7 ' ' >> >> >> >> >> >> // test.c >> >> >> #include >> >> >> >> >> >> int main() { >> >> >> int i; >> >> >> for (i = 0; i < 1000000; i++) { >> >> >> fprintf(stdout, " "); >> >> >> } >> >> >> return 0; >> >> >> } >> >> >> >> >> >> I compiled them both with -O2, and ran them redirecting their >> outputs >> >> >> to >> >> >> /dev/null. For the Haskell version I got times aroudn 0.3 seconds, >> >> >> while the >> >> >> C version was around 0.03. Is there any reason why in simple IO the >> >> >> Haskell >> >> >> version would be slower by an order of magnitude? >> >> > >> >> > >> >> > _______________________________________________ >> >> > Haskell-Cafe mailing list >> >> > Haskell-Cafe at haskell.org >> >> > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >> >> > >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >> > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cblp at cblp.su Thu May 5 09:03:39 2016 From: cblp at cblp.su (=?UTF-8?B?0K7RgNC40Lkg0KHRi9GA0L7QstC10YbQutC40LkgKFl1cml5IFN5cm92ZXRza2l5KQ==?=) Date: Thu, 5 May 2016 12:03:39 +0300 Subject: [Haskell-cafe] Fwd: Problem logging in GHC Trac In-Reply-To: References: Message-ID: Hello I enter my login and password at https://ghc.haskell.org/trac/ghc/login and get: Internal Server Error Please contact the server administrator, webmaster at localhost Who is responsible for the site? Who can fix it? -- Yuriy Syrovetskiy, http://cblp.su From amy at nualeargais.ie Fri May 6 09:40:13 2016 From: amy at nualeargais.ie (Amy de =?utf-8?b?QnVpdGzDqWly?=) Date: Fri, 6 May 2016 09:40:13 +0000 (UTC) Subject: [Haskell-cafe] Trouble building library with cabal-install 1.24 Message-ID: I'm trying to use cabal-install 1.24. To start fresh, I removed ~/.cabal and ~/.ghc, and then used the old cabal(-install) executable to do cabal update and cabal install cabal-install. Unfortunately, it seems that cabal-install is building everything except my library! $ cabal --version cabal-install version 1.24.0.0 compiled using version 1.24.0.0 of the Cabal library $ ghc --version The Glorious Glasgow Haskell Compilation System, version 7.10.3 $ cat cabal.project.local tests: True program-options ghc-options: -Werror $ cabal new-build --enable-test -v Project settings changed, reconfiguring... creating /home/eamybut/n?al/creatur/dist-newstyle creating /home/eamybut/n?al/creatur/dist-newstyle/cache creating /home/eamybut/.cabal/store/ghc-7.10.3 Reading installed packages... /usr/local/ghc-7.10.3/bin/ghc-pkg dump '--package-db=/home/eamybut/.cabal/store/ghc-7.10.3/package.db' -v0 /usr/local/ghc-7.10.3/bin/ghc --print-libdir -Werror In order, the following will be built: cond-0.4.1.1 (lib:cond) (requires build) primitive-0.6.1.0 (lib:primitive) (requires build) random-1.1 (lib:random) (requires build) MonadRandom-0.4.2.3 (lib:MonadRandom) (requires build) regex-base-0.93.2 (lib:regex-base) (requires build) regex-posix-0.95.2 (lib:regex-posix) (requires build) tf-random-0.5 (lib:tf-random) (requires build) QuickCheck-2.8.2 (lib:QuickCheck) (requires build) xml-1.3.14 (lib:xml) (requires build) test-framework-0.8.1.1 (lib:test-framework) (requires build) test-framework-hunit-0.3.0.2 (lib:test-framework-hunit) (requires build) test-framework-quickcheck2-0.3.0.3 (lib:test-framework-quickcheck2) (requires build) creatur-5.9.12 (lib:creatur test:creatur-tests) *test (first run) creating /home/eamybut/n?al/creatur/dist-newstyle/build creating /home/eamybut/n?al/creatur/dist-newstyle/tmp Extracting /home/eamybut/.cabal/packages/hackage.haskell.org/cond/0.4.1.1/cond-0.4.1.1.tar. gz to /home/eamybut/n?al/creatur/dist-newstyle/tmp/cond-4543... Extracting Extracting Extracting /home/eamybut/.cabal/packages/hackage.haskell.org/primitive/0.6.1.0/primitive-0. 6.1.0.tar.gz /home/eamybut/.cabal/packages/hackage.haskell.org/random/1.1/random-1.1.tar.gz /home/eamybut/.cabal/packages/hackage.haskell.org/regex-base/0.93.2/regex-base-0 .93.2.tar.gz Updating cond.cabal with the latest revision from the index. to /home/eamybut/n?al/creatur/dist-newstyle/tmp/primitive-4543... to /home/eamybut/n?al/creatur/dist-newstyle/tmp/random-4543... to /home/eamybut/n?al/creatur/dist-newstyle/tmp/regex-base-4543... creating dist Updating primitive.cabal with the latest revision from the index. Updating random.cabal with the latest revision from the index. Updating regex-base.cabal with the latest revision from the index. Configuring cond-0.4.1.1... creating dist creating dist creating dist /home/eamybut/.cabal/bin/cabal act-as-setup --build-type=Simple -- configure Configuring primitive-0.6.1.0... Configuring random-1.1... Configuring regex-base-0.93.2... --verbose=2 --builddir=dist --ghc --prefix=/home/eamybut/.cabal/store/ghc-7.10.3/cond-0.4.1.1-d6f8f52c204603b82b24 b34eb8efb77ce69172f7e29c5da408121c1e840e7bca --bindir=/home/eamybut/.cabal/store/ghc-7.10.3/cond-0.4.1.1-d6f8f52c204603b82b24 b34eb8efb77ce69172f7e29c5da408121c1e840e7bca/bin /home/eamybut/.cabal/bin/cabal act-as-setup --build-type=Simple -- configure /home/eamybut/.cabal/bin/cabal act-as-setup --build-type=Simple -- configure /home/eamybut/.cabal/bin/cabal act-as-setup --build-type=Simple -- configure --libdir=/home/eamybut/.cabal/store/ghc-7.10.3/cond-0.4.1.1-d6f8f52c204603b82b24 b34eb8efb77ce69172f7e29c5da408121c1e840e7bca/lib --verbose=2 --builddir=dist --ghc --verbose=2 --builddir=dist --ghc --verbose=2 --builddir=dist --ghc --libsubdir= --prefix=/home/eamybut/.cabal/store/ghc-7.10.3/primitive-0.6.1.0-b7ddd297d5514a8 7874afe52df39e3953f43ebb68440dbf31be727064e02c914 --prefix=/home/eamybut/.cabal/store/ghc-7.10.3/random-1.1-b26d9915a884bbc1b303e6 d2667f43890fe97c8ce038e14ab1c9b19e493af5c1 --prefix=/home/eamybut/.cabal/store/ghc-7.10.3/regex-base-0.93.2-b143cb5bc118558 645f7ba3efa292084e0faa0371afb4065baebdd6202d7600d --libexecdir=/home/eamybut/.cabal/store/ghc-7.10.3/cond-0.4.1.1-d6f8f52c204603b8 2b24b34eb8efb77ce69172f7e29c5da408121c1e840e7bca/libexec --bindir=/home/eamybut/.cabal/store/ghc-7.10.3/primitive-0.6.1.0-b7ddd297d5514a8 7874afe52df39e3953f43ebb68440dbf31be727064e02c914/bin --bindir=/home/eamybut/.cabal/store/ghc-7.10.3/random-1.1-b26d9915a884bbc1b303e6 d2667f43890fe97c8ce038e14ab1c9b19e493af5c1/bin --bindir=/home/eamybut/.cabal/store/ghc-7.10.3/regex-base-0.93.2-b143cb5bc118558 645f7ba3efa292084e0faa0371afb4065baebdd6202d7600d/bin --datadir=/home/eamybut/.cabal/store/ghc-7.10.3/cond-0.4.1.1-d6f8f52c204603b82b2 4b34eb8efb77ce69172f7e29c5da408121c1e840e7bca/share --libdir=/home/eamybut/.cabal/store/ghc-7.10.3/primitive-0.6.1.0-b7ddd297d5514a8 7874afe52df39e3953f43ebb68440dbf31be727064e02c914/lib --libdir=/home/eamybut/.cabal/store/ghc-7.10.3/random-1.1-b26d9915a884bbc1b303e6 d2667f43890fe97c8ce038e14ab1c9b19e493af5c1/lib --libdir=/home/eamybut/.cabal/store/ghc-7.10.3/regex-base-0.93.2-b143cb5bc118558 645f7ba3efa292084e0faa0371afb4065baebdd6202d7600d/lib --datasubdir= --libsubdir= --libsubdir= --libsubdir= --docdir=/home/eamybut/.cabal/store/ghc-7.10.3/cond-0.4.1.1-d6f8f52c204603b82b24 b34eb8efb77ce69172f7e29c5da408121c1e840e7bca/share/doc --libexecdir=/home/eamybut/.cabal/store/ghc-7.10.3/primitive-0.6.1.0-b7ddd297d55 14a87874afe52df39e3953f43ebb68440dbf31be727064e02c914/libexec --libexecdir=/home/eamybut/.cabal/store/ghc-7.10.3/random-1.1-b26d9915a884bbc1b3 03e6d2667f43890fe97c8ce038e14ab1c9b19e493af5c1/libexec --libexecdir=/home/eamybut/.cabal/store/ghc-7.10.3/regex-base-0.93.2-b143cb5bc11 8558645f7ba3efa292084e0faa0371afb4065baebdd6202d7600d/libexec --htmldir=/home/eamybut/.cabal/store/ghc-7.10.3/cond-0.4.1.1-d6f8f52c204603b82b2 4b34eb8efb77ce69172f7e29c5da408121c1e840e7bca/share/doc/html --datadir=/home/eamybut/.cabal/store/ghc-7.10.3/primitive-0.6.1.0-b7ddd297d5514a 87874afe52df39e3953f43ebb68440dbf31be727064e02c914/share --datadir=/home/eamybut/.cabal/store/ghc-7.10.3/random-1.1-b26d9915a884bbc1b303e 6d2667f43890fe97c8ce038e14ab1c9b19e493af5c1/share --datadir=/home/eamybut/.cabal/store/ghc-7.10.3/regex-base-0.93.2-b143cb5bc11855 8645f7ba3efa292084e0faa0371afb4065baebdd6202d7600d/share --haddockdir=/home/eamybut/.cabal/store/ghc-7.10.3/cond-0.4.1.1-d6f8f52c204603b8 2b24b34eb8efb77ce69172f7e29c5da408121c1e840e7bca/share/doc/html --datasubdir= --datasubdir= --datasubdir= --sysconfdir=/home/eamybut/.cabal/store/ghc-7.10.3/cond-0.4.1.1-d6f8f52c204603b8 2b24b34eb8efb77ce69172f7e29c5da408121c1e840e7bca/etc --docdir=/home/eamybut/.cabal/store/ghc-7.10.3/primitive-0.6.1.0-b7ddd297d5514a8 7874afe52df39e3953f43ebb68440dbf31be727064e02c914/share/doc --docdir=/home/eamybut/.cabal/store/ghc-7.10.3/random-1.1-b26d9915a884bbc1b303e6 d2667f43890fe97c8ce038e14ab1c9b19e493af5c1/share/doc --docdir=/home/eamybut/.cabal/store/ghc-7.10.3/regex-base-0.93.2-b143cb5bc118558 645f7ba3efa292084e0faa0371afb4065baebdd6202d7600d/share/doc --enable-library-vanilla --enable-library-profiling --enable-shared --htmldir=/home/eamybut/.cabal/store/ghc-7.10.3/primitive-0.6.1.0-b7ddd297d5514a 87874afe52df39e3953f43ebb68440dbf31be727064e02c914/share/doc/html --htmldir=/home/eamybut/.cabal/store/ghc-7.10.3/random-1.1-b26d9915a884bbc1b303e 6d2667f43890fe97c8ce038e14ab1c9b19e493af5c1/share/doc/html --htmldir=/home/eamybut/.cabal/store/ghc-7.10.3/regex-base-0.93.2-b143cb5bc11855 8645f7ba3efa292084e0faa0371afb4065baebdd6202d7600d/share/doc/html --disable-executable-dynamic --disable-profiling --profiling-detail=default --haddockdir=/home/eamybut/.cabal/store/ghc-7.10.3/primitive-0.6.1.0-b7ddd297d55 14a87874afe52df39e3953f43ebb68440dbf31be727064e02c914/share/doc/html --haddockdir=/home/eamybut/.cabal/store/ghc-7.10.3/random-1.1-b26d9915a884bbc1b3 03e6d2667f43890fe97c8ce038e14ab1c9b19e493af5c1/share/doc/html --haddockdir=/home/eamybut/.cabal/store/ghc-7.10.3/regex-base-0.93.2-b143cb5bc11 8558645f7ba3efa292084e0faa0371afb4065baebdd6202d7600d/share/doc/html --library-profiling-detail=default --enable-optimization --disable-debug-info --sysconfdir=/home/eamybut/.cabal/store/ghc-7.10.3/primitive-0.6.1.0-b7ddd297d55 14a87874afe52df39e3953f43ebb68440dbf31be727064e02c914/etc --sysconfdir=/home/eamybut/.cabal/store/ghc-7.10.3/random-1.1-b26d9915a884bbc1b3 03e6d2667f43890fe97c8ce038e14ab1c9b19e493af5c1/etc --sysconfdir=/home/eamybut/.cabal/store/ghc-7.10.3/regex-base-0.93.2-b143cb5bc11 8558645f7ba3efa292084e0faa0371afb4065baebdd6202d7600d/etc --disable-library-for-ghci --disable-split-objs --disable-executable-stripping --enable-library-vanilla --enable-library-profiling --enable-shared --enable-library-vanilla --enable-library-profiling --enable-shared --enable-library-vanilla --enable-library-profiling --enable-shared --disable-library-stripping --package-db=clear --package-db=global --disable-executable-dynamic --disable-profiling --profiling-detail=default --disable-executable-dynamic --disable-profiling --profiling-detail=default --disable-executable-dynamic --disable-profiling --profiling-detail=default --package-db=/home/eamybut/.cabal/store/ghc-7.10.3/package.db --library-profiling-detail=default --enable-optimization --disable-debug-info --library-profiling-detail=default --enable-optimization --disable-debug-info --library-profiling-detail=default --enable-optimization --disable-debug-info --ipid=cond-0.4.1.1-d6f8f52c204603b82b24b34eb8efb77ce69172f7e29c5da408121c1e840e 7bca --disable-library-for-ghci --disable-split-objs --disable-executable-stripping --disable-library-for-ghci --disable-split-objs --disable-executable-stripping --disable-library-for-ghci --disable-split-objs --disable-executable-stripping --dependency=base=base-4.8.2.0-0d6d1084fbc041e1cded9228e80e264d --disable-library-stripping --package-db=clear --package-db=global --disable-library-stripping --package-db=clear --package-db=global --disable-library-stripping --package-db=clear --package-db=global --disable-tests --disable-coverage --exact-configuration --disable-benchmarks --package-db=/home/eamybut/.cabal/store/ghc-7.10.3/package.db --package-db=/home/eamybut/.cabal/store/ghc-7.10.3/package.db --package-db=/home/eamybut/.cabal/store/ghc-7.10.3/package.db --with-ghc=/usr/local/ghc-7.10.3/bin/ghc --ipid=primitive-0.6.1.0-b7ddd297d5514a87874afe52df39e3953f43ebb68440dbf31be7270 64e02c914 --ipid=random-1.1-b26d9915a884bbc1b303e6d2667f43890fe97c8ce038e14ab1c9b19e493af5 c1 --flags=splitbase --flags=newbase --with-ghc-pkg=/usr/local/ghc-7.10.3/bin/ghc-pkg --ghc-option=-Werror --dependency=base=base-4.8.2.0-0d6d1084fbc041e1cded9228e80e264d --dependency=base=base-4.8.2.0-0d6d1084fbc041e1cded9228e80e264d --ipid=regex-base-0.93.2-b143cb5bc118558645f7ba3efa292084e0faa0371afb4065baebdd6 202d7600d --dependency=ghc-prim=ghc-prim-0.4.0.0-6cdc86811872333585fa98756aa7c51e --dependency=time=time-1.6-3b93b66397d7b7d84c3a87826ae1549fc4e47935065267f486fdc 3425d250cd5 --dependency=array=array-0.5.1.0-960bf9ae8875cc30355e086f8853a049 --dependency=transformers=transformers-0.5.2.0-c4818cc3cc5467e714fd3fd12dcbf7740 9ca3ca7292b47a5830cfcb4fb5911e2 --disable-tests --disable-coverage --exact-configuration --disable-benchmarks --dependency=base=base-4.8.2.0-0d6d1084fbc041e1cded9228e80e264d Redirecting build log to {handle: /home/eamybut/.cabal/logs/cond-0.4.1.1.log} --disable-tests --disable-coverage --exact-configuration --disable-benchmarks --with-ghc=/usr/local/ghc-7.10.3/bin/ghc --dependency=bytestring=bytestring-0.10.6.0-9a873bcf33d6ce2fd2698ce69e2c1c66 --with-ghc=/usr/local/ghc-7.10.3/bin/ghc --with-ghc-pkg=/usr/local/ghc-7.10.3/bin/ghc-pkg --ghc-option=-Werror --dependency=containers=containers-0.5.6.2-59326c33e30ec8f6afd574cbac625bbb --with-ghc-pkg=/usr/local/ghc-7.10.3/bin/ghc-pkg --ghc-option=-Werror --dependency=mtl=mtl-2.2.1-f8863ab628c53078d6adbcf7634212242d99bcdf1c73497f1131e 24fcafd4187 --disable-tests --disable-coverage --exact-configuration --disable-benchmarks Redirecting build log to {handle: /home/eamybut/.cabal/logs/random-1.1.log} --with-ghc=/usr/local/ghc-7.10.3/bin/ghc Redirecting build log to {handle: --with-ghc-pkg=/usr/local/ghc-7.10.3/bin/ghc-pkg --ghc-option=-Werror /home/eamybut/.cabal/logs/primitive-0.6.1.0.log} Redirecting build log to {handle: /home/eamybut/.cabal/logs/regex-base-0.93.2.log} Building regex-base-0.93.2... /home/eamybut/.cabal/bin/cabal act-as-setup --build-type=Simple -- build --verbose=2 --builddir=dist Redirecting build log to {handle: /home/eamybut/.cabal/logs/regex-base-0.93.2.log} Building random-1.1... /home/eamybut/.cabal/bin/cabal act-as-setup --build-type=Simple -- build --verbose=2 --builddir=dist Redirecting build log to {handle: /home/eamybut/.cabal/logs/random-1.1.log} Building primitive-0.6.1.0... /home/eamybut/.cabal/bin/cabal act-as-setup --build-type=Simple -- build --verbose=2 --builddir=dist Redirecting build log to {handle: /home/eamybut/.cabal/logs/primitive-0.6.1.0.log} Building cond-0.4.1.1... /home/eamybut/.cabal/bin/cabal act-as-setup --build-type=Simple -- build --verbose=2 --builddir=dist Redirecting build log to {handle: /home/eamybut/.cabal/logs/cond-0.4.1.1.log} Extracting /home/eamybut/.cabal/packages/hackage.haskell.org/xml/1.3.14/xml-1.3.14.tar.gz to /home/eamybut/n?al/creatur/dist-newstyle/tmp/xml-4543... Updating xml.cabal with the latest revision from the index. creating dist Configuring xml-1.3.14... /home/eamybut/.cabal/bin/cabal act-as-setup --build-type=Simple -- configure --verbose=2 --builddir=dist --ghc --prefix=/home/eamybut/.cabal/store/ghc-7.10.3/xml-1.3.14-b04f5878120533b38458e7 afa38083e761daf4b6cf823ee2a31d1d5bba8de548 --bindir=/home/eamybut/.cabal/store/ghc-7.10.3/xml-1.3.14-b04f5878120533b38458e7 afa38083e761daf4b6cf823ee2a31d1d5bba8de548/bin --libdir=/home/eamybut/.cabal/store/ghc-7.10.3/xml-1.3.14-b04f5878120533b38458e7 afa38083e761daf4b6cf823ee2a31d1d5bba8de548/lib --libsubdir= --libexecdir=/home/eamybut/.cabal/store/ghc-7.10.3/xml-1.3.14-b04f5878120533b384 58e7afa38083e761daf4b6cf823ee2a31d1d5bba8de548/libexec --datadir=/home/eamybut/.cabal/store/ghc-7.10.3/xml-1.3.14-b04f5878120533b38458e 7afa38083e761daf4b6cf823ee2a31d1d5bba8de548/share --datasubdir= --docdir=/home/eamybut/.cabal/store/ghc-7.10.3/xml-1.3.14-b04f5878120533b38458e7 afa38083e761daf4b6cf823ee2a31d1d5bba8de548/share/doc --htmldir=/home/eamybut/.cabal/store/ghc-7.10.3/xml-1.3.14-b04f5878120533b38458e 7afa38083e761daf4b6cf823ee2a31d1d5bba8de548/share/doc/html --haddockdir=/home/eamybut/.cabal/store/ghc-7.10.3/xml-1.3.14-b04f5878120533b384 58e7afa38083e761daf4b6cf823ee2a31d1d5bba8de548/share/doc/html --sysconfdir=/home/eamybut/.cabal/store/ghc-7.10.3/xml-1.3.14-b04f5878120533b384 58e7afa38083e761daf4b6cf823ee2a31d1d5bba8de548/etc --enable-library-vanilla --enable-library-profiling --enable-shared --disable-executable-dynamic --disable-profiling --profiling-detail=default --library-profiling-detail=default --enable-optimization --disable-debug-info --disable-library-for-ghci --disable-split-objs --disable-executable-stripping --disable-library-stripping --package-db=clear --package-db=global --package-db=/home/eamybut/.cabal/store/ghc-7.10.3/package.db --ipid=xml-1.3.14-b04f5878120533b38458e7afa38083e761daf4b6cf823ee2a31d1d5bba8de5 48 --dependency=base=base-4.8.2.0-0d6d1084fbc041e1cded9228e80e264d --dependency=bytestring=bytestring-0.10.6.0-9a873bcf33d6ce2fd2698ce69e2c1c66 --dependency=text=text-1.2.2.1-ba97440de9fbd614cd8b02c1d9fda7e9073a288481e7e539c 2629ac910e67bf4 --disable-tests --disable-coverage --exact-configuration --disable-benchmarks --with-ghc=/usr/local/ghc-7.10.3/bin/ghc --with-ghc-pkg=/usr/local/ghc-7.10.3/bin/ghc-pkg --ghc-option=-Werror Redirecting build log to {handle: /home/eamybut/.cabal/logs/xml-1.3.14.log} Building xml-1.3.14... /home/eamybut/.cabal/bin/cabal act-as-setup --build-type=Simple -- build --verbose=2 --builddir=dist Redirecting build log to {handle: /home/eamybut/.cabal/logs/xml-1.3.14.log} That's the last line. No mention of actually building creatur (my library). $ find dist-newstyle dist-newstyle dist-newstyle/tmp dist-newstyle/cache dist-newstyle/cache/source-hashes dist-newstyle/cache/improved-plan dist-newstyle/cache/plan.json dist-newstyle/cache/compiler dist-newstyle/cache/elaborated-plan dist-newstyle/cache/solver-plan dist-newstyle/cache/config dist-newstyle/build $ find dist dist $ cabal info creatur * creatur (library) Synopsis: Framework for artificial life experiments. Versions available: 4.2.0, 4.3.2, 4.3.3, 5.7.3, 5.8.0, 5.8.2, 5.9.9, 5.9.10, 5.9.11 (and 51 others) Versions installed: [ Not installed ] . . . I'm using the same cabal file I've used with sandboxes. From adam at bergmark.nl Fri May 6 10:10:42 2016 From: adam at bergmark.nl (Adam Bergmark) Date: Fri, 6 May 2016 12:10:42 +0200 Subject: [Haskell-cafe] Taking over cmdtheline In-Reply-To: <5724F3A0.6070302@gmail.com> References: <5724F3A0.6070302@gmail.com> Message-ID: Hi Greg, I noticed that there was no CC to the maintainer in your message, so I added Eli to the conversation. - Adam On Sat, Apr 30, 2016 at 8:04 PM, Gregory Crosswhite wrote: > The package cmdtheline has not been updated since Apr 30, 2013, and it is > broken with the current version of GHC; it needs to have its upper bound on > transformers bumped. I tried contacting the author three months ago and > three weeks ago to ask him to fix the package, but I received no response. > I contacted him one more time one week ago to tell him that I intended to > take over the package, and still I received no response. > > Thus, following the instructions on Hackage for taking over a package, I > am officially stating my intent to take over this package so that I can fix > it. > > Cheers, > Greg > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From spam at scientician.net Fri May 6 10:29:48 2016 From: spam at scientician.net (Bardur Arantsson) Date: Fri, 6 May 2016 12:29:48 +0200 Subject: [Haskell-cafe] Trouble building library with cabal-install 1.24 In-Reply-To: References: Message-ID: On 05/06/2016 11:40 AM, Amy de Buitl?ir wrote: > I'm trying to use cabal-install 1.24. To start fresh, I removed ~/.cabal and > ~/.ghc, and then used the old cabal(-install) executable to do cabal update > and cabal install cabal-install. > > Unfortunately, it seems that cabal-install is building everything except my > library! > > $ cabal --version > cabal-install version 1.24.0.0 > compiled using version 1.24.0.0 of the Cabal library > > $ ghc --version > The Glorious Glasgow Haskell Compilation System, version 7.10.3 > > $ cat cabal.project.local > tests: True > > program-options > ghc-options: -Werror > > $ cabal new-build --enable-test -v I seem to recall that you need to explicitly mention "your-library" on the command line here. From amy at nualeargais.ie Fri May 6 10:35:33 2016 From: amy at nualeargais.ie (Amy de =?utf-8?b?QnVpdGzDqWly?=) Date: Fri, 6 May 2016 10:35:33 +0000 (UTC) Subject: [Haskell-cafe] Trouble building library with cabal-install 1.24 References: Message-ID: Bardur Arantsson scientician.net> writes: > > $ cabal new-build --enable-test -v > > I seem to recall that you need to explicitly mention "your-library" on > the command line here. OK, I tried that just now, but got the same result cabal new-build --enable-test -v creatur By the way, creatur (my library) is on disk, in the directory I'm working in. Here's the cabal file: $ cat creatur.cabal Name: creatur Version: 5.9.12 Stability: experimental Synopsis: Framework for artificial life experiments. Description: A software framework for automating experiments with artificial life. It provides a daemon which maintains its own "clock", schedules events, provides logging, and ensures that each agent gets its turn to use the CPU. You can use other applications on the computer at the same time without fear of interfering with experiments; they will run normally, just more slowly. See the tutorial at for examples on how to use the Cr?at?r framework. . About the name: \"Cr?at?r\" (pronounced kray-toor) is an Irish word meaning animal, creature, or an unfortunate person. Category: AI License: BSD3 License-file: LICENSE Copyright: (c) Amy de Buitl?ir 2010-2015 Homepage: https://github.com/mhwombat/creatur Bug-reports: https://github.com/mhwombat/creatur/issues Author: Amy de Buitl?ir Maintainer: amy at nualeargais.ie Build-Type: Simple Cabal-Version: >=1.8 source-repository head type: git location: https://github.com/mhwombat/creatur.git source-repository this type: git location: https://github.com/mhwombat/creatur.git tag: 5.9.10 library GHC-Options: -Wall -fno-warn-orphans Hs-source-dirs: src exposed-modules: ALife.Creatur, ALife.Creatur.Checklist, ALife.Creatur.Clock, ALife.Creatur.Counter, ALife.Creatur.Daemon, ALife.Creatur.Database, ALife.Creatur.Database.CachedFileSystem, ALife.Creatur.Database.CachedFileSystemInternal, ALife.Creatur.Database.FileSystem, ALife.Creatur.Genetics.Analysis, ALife.Creatur.Genetics.BRGCBool, ALife.Creatur.Genetics.BRGCWord8, ALife.Creatur.Genetics.BRGCWord16, ALife.Creatur.Genetics.Diploid, ALife.Creatur.Genetics.Recombination, ALife.Creatur.Genetics.Reproduction.Sexual, ALife.Creatur.Genetics.Reproduction.SimplifiedSexual, ALife.Creatur.Logger, ALife.Creatur.Logger.SimpleLogger, ALife.Creatur.Logger.SimpleRotatingLogger, ALife.Creatur.Namer, ALife.Creatur.Persistent, ALife.Creatur.Universe, ALife.Creatur.Task, ALife.Creatur.Util Other-modules: Paths_creatur Build-Depends: array ==0.5.*, base ==4.* && >= 4.8, bytestring ==0.10.*, cond ==0.4.*, cereal ==0.5.*, directory ==1.2.*, exceptions ==0.8.*, filepath ==1.4.*, gray-extended ==1.*, hdaemonize ==0.5.*, hsyslog ==2.0, MonadRandom ==0.4.*, mtl ==2.2.*, old-locale ==1.0.*, process ==1.4.*, random ==1.1.*, split ==0.2.*, time ==1.6.*, transformers ==0.5.*, unix ==2.7.*, zlib ==0.6.* Test-suite creatur-tests Type: exitcode-stdio-1.0 Main-is: TestAll.hs GHC-Options: -Wall Hs-source-dirs: test Build-Depends: array ==0.5.*, base ==4.* && >= 4.8, binary ==0.7.*, cereal ==0.5.*, creatur, directory ==1.2.*, filepath ==1.4.*, hsyslog ==2.0, HUnit ==1.3.*, MonadRandom ==0.4.*, mtl ==2.2.*, temporary ==1.2.*, test-framework ==0.8.*, test-framework-hunit ==0.3.*, test-framework-quickcheck2 ==0.3.*, QuickCheck ==2.8.* Other-modules: ALife.Creatur.ChecklistQC ALife.Creatur.CounterQC ALife.Creatur.Database.CachedFileSystemQC ALife.Creatur.Database.FileSystemQC ALife.Creatur.Genetics.BRGCBoolBench ALife.Creatur.Genetics.BRGCBoolQC ALife.Creatur.Genetics.BRGCWord16QC ALife.Creatur.Genetics.BRGCWord8Bench ALife.Creatur.Genetics.BRGCWord8QC ALife.Creatur.Genetics.DiploidQC, ALife.Creatur.Genetics.RecombinationQC ALife.Creatur.PersistentQC ALife.Creatur.UniverseQC ALife.Creatur.UtilQC -- Benchmark creatur-bench -- Type: exitcode-stdio-1.0 -- Main-is: BenchAll.hs -- GHC-Options: -Wall -- Hs-source-dirs: test -- Build-Depends: -- base ==4.* && >= 4.8, -- creatur, -- criterion ==0.8.*, -- test-framework ==0.8.* -- Other-modules: ALife.Creatur.Genetics.BRGCWord8Bench From jake.waksbaum at gmail.com Fri May 6 12:52:30 2016 From: jake.waksbaum at gmail.com (Jake) Date: Fri, 06 May 2016 12:52:30 +0000 Subject: [Haskell-cafe] GHC.Prim: Resizable Multidimensional array Message-ID: I'm trying to create a resizable multidimensional array using the primitive array stuff in GHC.Prim. I see that the only resizable array is the ByteArray#, but the only array that supports multidimensionality is the ArrayArray# as far as I can tell. I have groups of 4 Double#s that I want to have a resizable array of, so only really the "first dimension" needs to be resizable. I was thinking if there was a way to get the pointer of a SmallArray# as an Addr# I could use the ability of ByteArray#s to store Addr#s. The other option I was considering was to simply have a mapping similar to the ones provided by Data.Ix that maps pairs of numbers to a single index, and in that way use a single ByteArray# to store everything. However, because this will be a fairly large array it seems like it is a much better idea to avoid allocating and reallocating that humongous chunk of memory when I can keep it spread out in smaller chunks by storing pointers to smaller arrays in the larger array. But maybe that isn't an important consideration? Thanks, Jake -------------- next part -------------- An HTML attachment was scrubbed... URL: From amy at nualeargais.ie Fri May 6 13:44:08 2016 From: amy at nualeargais.ie (Amy de =?utf-8?b?QnVpdGzDqWly?=) Date: Fri, 6 May 2016 13:44:08 +0000 (UTC) Subject: [Haskell-cafe] Trouble building library with cabal-install 1.24 References: Message-ID: Someone with a monad-friendly email address suggested a fix. 1. Delete cabal.project.local 2. cabal new-build --enable-tests Finally, the creatur library is built! 3. Run tests: dist-newstyle/build/creatur-5.9.12/build/creatur-tests/creatur-tests From michael at schmong.org Fri May 6 18:29:40 2016 From: michael at schmong.org (Michael Litchard) Date: Fri, 6 May 2016 11:29:40 -0700 Subject: [Haskell-cafe] Code critique request Message-ID: I've got this fizzbuzz project I am using for a blog series, among other things. In this version, the fizzbuzz function is fed from a Fibonacci generator. I'm particularly concerned with the efficiency of the Fibonacci generator, but all scrutiny is welcomed. I'll included a link to the entire project, but below are the parts I think would be sufficient to spot trouble with how I am generating Fibonacci numbers. -- Driver function performs following-- (1) checks that input is proper-- (2) creates integer list for fibonacci generator-- (3) calculates first x in fibonnaci sequence-- (4) generates fizzbuzz output using (3) fizzBuzzFib :: [Text] -> Either FizzError [Text] fizzBuzzFib str = mapM fizzbuzz =<< mapM fibb =<< -- Possible problem here(\x -> Right [1 .. x]) =<< convertToPInt =<< mustHaveOne str fibb :: Integer -> Either FizzError Integer fibb n = Right $ snd . foldl' fib' (1, 0) . map (toEnum . fromIntegral) $ unfoldl divs n where unfoldl f x = case f x of Nothing -> [] Just (u, v) -> unfoldl f v ++ [u] divs 0 = Nothing divs k = Just (uncurry (flip (,)) (k `divMod` 2)) fib' (f, g) p | p = (f*(f+c*g), f^c + g^c) | otherwise = (f^c+g^c, g*(c*f-g)) where c :: Integer -- See codebase for reasons c = 2 The whole project, for your critiquing eye:https://github.com/mlitchard/swiftfizz -------------- next part -------------- An HTML attachment was scrubbed... URL: From volhovm.cs at gmail.com Fri May 6 20:28:50 2016 From: volhovm.cs at gmail.com (Mikhail Volkhov) Date: Fri, 6 May 2016 23:28:50 +0300 Subject: [Haskell-cafe] Storing big datasets Message-ID: <572CFE82.7070209@gmail.com> Hi! I'm using ACID package as main database -- it's simple and... ACID (which is cool of course). So now I need to store up to ~30GB of data in a single data structure (!) that will be constantly updated (some kind of a huge tree set). Here's a question -- how to operate that big structure? 1. It doesn't even fit in RAM 2. It should be updated atomically and frequently (every 10 seconds up to 500 elements out of 10^7). 3. What structures should I use? I'd like to store up to 10^6~10^7 some simple elements there too, that will be gigabytes of data. So it seems to me I can't use Data.Set. Thanks for any ideas! -- Volkhov Mikhail M3#38 ITMO study group 17' Computer Technologies Department From spam at scientician.net Fri May 6 20:41:57 2016 From: spam at scientician.net (Bardur Arantsson) Date: Fri, 6 May 2016 22:41:57 +0200 Subject: [Haskell-cafe] Storing big datasets In-Reply-To: <572CFE82.7070209@gmail.com> References: <572CFE82.7070209@gmail.com> Message-ID: On 05/06/2016 10:28 PM, Mikhail Volkhov wrote: > Hi! > > I'm using ACID package as main database -- it's simple and... ACID > (which is cool of course). > Just for clarification: Do you mean acid-state? > So now I need to store up to ~30GB of data in a single data structure > (!) that will be constantly updated (some kind of a huge tree set). > Here's a question -- how to operate that big structure? > 1. It doesn't even fit in RAM Yes it does. My desktop machine has 32GB RAM. I'm not trying to brag or anything, and *you* may not have that amount of memory, but it *should* be cheap enough to buy enough RAM if it avoids radically redesigning an existing system (with all the associated risk, developer time, etc.). If this is a one-off or rare occurrence, you could get 160GB RAM on an Amazon M4 instance (m4.10xlarge) if you wanted to. (Amazon's pricing structure is incredibly opaque and I didn't do a thorough investigation, so I apologize if this is wrong.) > 2. It should be updated atomically and frequently (every 10 seconds up > to 500 elements out of 10^7). This is a bit vague. Do you mean that an *average* of 500 (out of 10^7) will be updated every 10 seconds? > 3. What structures should I use? I'd like to store up to 10^6~10^7 some > simple elements there too, that will be gigabytes of data. So it seems > to me I can't use Data.Set. > Well, if storing things in RAM is out of the question, so is using Data.Set. Regards, From volhovm.cs at gmail.com Fri May 6 20:55:07 2016 From: volhovm.cs at gmail.com (Mikhail Volkhov) Date: Fri, 6 May 2016 23:55:07 +0300 Subject: [Haskell-cafe] Storing big datasets In-Reply-To: References: <572CFE82.7070209@gmail.com> Message-ID: <572D04AB.7070507@gmail.com> Thank you for the answer! 1. acid-state, yes. 2. The application is supposed to work on the regular pc, without 32gb of ram. I agree that it doesn't cost much to buy 32gb of ram, but it's not the case. 3. Come to think of it, i think it would be more like about 10k elements per 10-20 second, yes. On average. On 05/06/2016 11:41 PM, Bardur Arantsson wrote: > On 05/06/2016 10:28 PM, Mikhail Volkhov wrote: >> Hi! >> >> I'm using ACID package as main database -- it's simple and... ACID >> (which is cool of course). >> > > Just for clarification: Do you mean acid-state? > >> So now I need to store up to ~30GB of data in a single data structure >> (!) that will be constantly updated (some kind of a huge tree set). >> Here's a question -- how to operate that big structure? >> 1. It doesn't even fit in RAM > > Yes it does. My desktop machine has 32GB RAM. > > I'm not trying to brag or anything, and *you* may not have that amount > of memory, but it *should* be cheap enough to buy enough RAM if it > avoids radically redesigning an existing system (with all the associated > risk, developer time, etc.). > > If this is a one-off or rare occurrence, you could get 160GB RAM on an > Amazon M4 instance (m4.10xlarge) if you wanted to. (Amazon's pricing > structure is incredibly opaque and I didn't do a thorough investigation, > so I apologize if this is wrong.) > >> 2. It should be updated atomically and frequently (every 10 seconds up >> to 500 elements out of 10^7). > > This is a bit vague. Do you mean that an *average* of 500 (out of 10^7) > will be updated every 10 seconds? > >> 3. What structures should I use? I'd like to store up to 10^6~10^7 some >> simple elements there too, that will be gigabytes of data. So it seems >> to me I can't use Data.Set. >> > > Well, if storing things in RAM is out of the question, so is using Data.Set. > > Regards, > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > -- Volkhov Mikhail M3#38 ITMO study group 17' Computer Technologies Department From michael at schmong.org Fri May 6 21:21:15 2016 From: michael at schmong.org (Michael Litchard) Date: Fri, 6 May 2016 14:21:15 -0700 Subject: [Haskell-cafe] Code critique request In-Reply-To: References: Message-ID: Thank you David, for taking all that time on my project. I got so much more than I was expecting. I take it my concern was focused in the wrong place? Time-space complexity of mapM fibb is okay? On Fri, May 6, 2016 at 1:37 PM, David McBride wrote: > A lot of your functions return Either FizError a when they obviously can't > have an error? I prefer to keep the functions as pure as they can be, and > then lift them into Either in the few cases where I'd need them to be in > that type. > > How about fibb :: Integer -> Integer, fizzbuzz :: Integer -> Text, then > in the above code: > mapM (Right <$> fizzbuzz) =<< ... =<< mapM (Right <$> fibb) =<< ... > > This also greatly simplifies many of your tests and benchmarks. For > example src-test/PropTests/Fibonacci.hs, testfib changes from > > testfib n = > case (fibb n) of > Left _ -> False > Right n' -> isFib n' > > to > > testfib = isFib . fibb > > in src-test/UnitTests/Fibonacci.hs, fibs changes from > > fibs = [Right 1,Right 1,Right 2,Right 3,Right 5,Right 8,Right 13,Right > 21,Right 34,Right 55] > > to > > fibs = [1,1,2,3,5,8,13,21,34,55] > > among others. > > In fizzbuzz, I would, instead of converting it to maybe and then using > fromMaybe, use the option function from semigroups which is the option > equivalent to maybe, and contains all the functionality of fromMaybe. > fizzbuzz :: Integer -> Text > fizzbuzz i = option (show i) id fizzbuzz' > > Your type annotation on c = 2 and subsequent comments are unnecessary if > fibb has a type annotation, which it does. I would also recommend adding > types for divs and fib' as the types are non obvious and I had to use > typeholes to find them. > > In fibb, I would change map (toEnum . fromIntegral) to map (>0) (or /= > 0). It is easier to understand, faster, and will not blow up on negative > numbers (I realize there can't be, but it was not obvious to me). > > You wrote an unfoldl, but I'm pretty sure you could replace that with > reverse (unfoldr ...). Due to the fact that you are appending with (++) in > your implementation anyways, it is much more efficient. My final version > of fibb looks like this, and passes your tests. > fibb = snd . foldl' fib' (1, 0) . map (>0) . reverse . unfoldr divs > > boolToEither can be written with an if statement instead of case > boolToEither bool a b = if bool then Right b else Left a > > Stylistically, I would put argument validation into src-exe and into the > main function, allowing it to bail with an argument error before ever > getting to your fizzbuzz code, which should not concern itself with program > argument validation. I realize you are intending to demonstrate monads > using either in your blog, so carry on if that's the case. > > Some general advice I would give, is that if a function isn't doing as > little as it can, try pulling out some of the stuff it doesn't need to do > out into a shallower part of your program. > > For example, when I look at the fibb where fib' function, fib' :: (a, a) > -> Bool -> (a, a), where depending on the bool, and nothing else, it does > two completely different things. Maybe it should be two different > functions, with the bool checking outside? I'm not familiar enough with > what you are trying to do to say that that can be done, but that is my > first instinct. > > As to the structure of your project, it looks great. I may have learned a > few things... > > > On Fri, May 6, 2016 at 2:29 PM, Michael Litchard > wrote: > >> I've got this fizzbuzz project I am using for a blog series, among other >> things. In this version, the fizzbuzz function is fed from a Fibonacci >> generator. I'm particularly concerned with the efficiency of the Fibonacci >> generator, but all scrutiny is welcomed. >> >> I'll included a link to the entire project, but below are the parts I >> think would be sufficient to spot trouble with how I am generating >> Fibonacci numbers. >> >> -- Driver function performs following-- (1) checks that input is proper-- (2) creates integer list for fibonacci generator-- (3) calculates first x in fibonnaci sequence-- (4) generates fizzbuzz output using (3) >> >> fizzBuzzFib :: [Text] -> Either FizzError [Text] >> fizzBuzzFib str = >> mapM fizzbuzz =<< >> mapM fibb =<< -- Possible problem here(\x -> Right [1 .. x]) =<< >> convertToPInt =<< >> mustHaveOne str >> >> fibb :: Integer -> Either FizzError Integer >> fibb n = Right $ snd . foldl' fib' (1, 0) . map (toEnum . fromIntegral) $ unfoldl divs n >> where >> unfoldl f x = >> case f x of >> Nothing -> [] >> Just (u, v) -> unfoldl f v ++ [u] >> >> divs 0 = Nothing >> divs k = Just (uncurry (flip (,)) (k `divMod` 2)) >> >> fib' (f, g) p >> | p = (f*(f+c*g), f^c + g^c) >> | otherwise = (f^c+g^c, g*(c*f-g)) >> where >> c :: Integer -- See codebase for reasons >> c = 2 >> >> The whole project, for your critiquing eye:https://github.com/mlitchard/swiftfizz >> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at schmong.org Fri May 6 23:46:20 2016 From: michael at schmong.org (Michael Litchard) Date: Fri, 6 May 2016 16:46:20 -0700 Subject: [Haskell-cafe] The maths behind the Fastest Fibb In The West. Message-ID: I've been working on a project that needs a good fibonacci generator, and I'm to the point where can now improve upon this one: https://wiki.haskell.org/The_Fibonacci_sequence#Fastest_Fib_in_the_West thanks to this guy: https://groups.google.com/forum/#!topic/haskell-cafe/HUgbAUCvCp4 He suggested breaking up a guard into two diffeent functions, which I can do, but I don't know what to call them because I don't know why the operations are different. I'm referring to this section: fib' (f, g) p | p = (f*(f+2*g), f^2 + g^2) | otherwise = (f^2+g^2, g*(2*f-g)) I'd like to know the reason why each guard does two entirely different things, so I know what to call the functions when I seperate them out. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lanablack at amok.cc Sat May 7 00:27:03 2016 From: lanablack at amok.cc (Lana Black) Date: Sat, 07 May 2016 00:27:03 +0000 Subject: [Haskell-cafe] Storing big datasets In-Reply-To: <572CFE82.7070209@gmail.com> References: <572CFE82.7070209@gmail.com> Message-ID: <20160507002703.4378706.29272.3461@amok.cc> Hi Mikhail, Have you considered external database engines? I suppose you could benefit from using Redis in your case. ? Original Message ? From: Mikhail Volkhov Sent: Friday, May 6, 2016 8:28 PM To: haskell-cafe at haskell.org Subject: [Haskell-cafe] Storing big datasets Hi! I'm using ACID package as main database -- it's simple and... ACID (which is cool of course). So now I need to store up to ~30GB of data in a single data structure (!) that will be constantly updated (some kind of a huge tree set). Here's a question -- how to operate that big structure? 1. It doesn't even fit in RAM 2. It should be updated atomically and frequently (every 10 seconds up to 500 elements out of 10^7). 3. What structures should I use? I'd like to store up to 10^6~10^7 some simple elements there too, that will be gigabytes of data. So it seems to me I can't use Data.Set. Thanks for any ideas! -- Volkhov Mikhail M3#38 ITMO study group 17' Computer Technologies Department _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe at haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe From wntuwntu at gmail.com Sat May 7 00:29:49 2016 From: wntuwntu at gmail.com (Eunsu Kim) Date: Fri, 6 May 2016 19:29:49 -0500 Subject: [Haskell-cafe] I have a question Message-ID: Hi I don?t want to receive this mail anymore. what should do? thanks From fa-ml at ariis.it Sat May 7 00:30:24 2016 From: fa-ml at ariis.it (Francesco Ariis) Date: Sat, 7 May 2016 02:30:24 +0200 Subject: [Haskell-cafe] I have a question In-Reply-To: References: Message-ID: <20160507003024.GA15040@casa.casa> On Fri, May 06, 2016 at 07:29:49PM -0500, Eunsu Kim wrote: > Hi > > I don?t want to receive this mail anymore. what should do? > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Go here, click unsubscribe, follow instructions. From erantapaa at gmail.com Sat May 7 02:38:35 2016 From: erantapaa at gmail.com (Erik Rantapaa) Date: Fri, 6 May 2016 19:38:35 -0700 (PDT) Subject: [Haskell-cafe] The maths behind the Fastest Fibb In The West. In-Reply-To: References: Message-ID: <2a3845ec-d552-413c-9cc3-bc84aba7e571@googlegroups.com> On Friday, May 6, 2016 at 6:46:26 PM UTC-5, Michael Litchard wrote: > > I've been working on a project that needs a good fibonacci generator, and > I'm to the point where can now improve upon this one: > https://wiki.haskell.org/The_Fibonacci_sequence#Fastest_Fib_in_the_West > > thanks to this guy: > https://groups.google.com/forum/#!topic/haskell-cafe/HUgbAUCvCp4 > > He suggested breaking up a guard into two diffeent functions, which I can > do, but I don't know what to call them because I don't know why the > operations are different. I'm referring to this section: > > fib' (f, g) p > | p = (f*(f+2*g), f^2 + g^2) > | otherwise = (f^2+g^2, g*(2*f-g)) > > I'd like to know the reason why each guard does two entirely different things, so I know what to call the functions when I seperate them out. > > Clearly `p` is a Bool, and it comes from the expression: map (toEnum . fromIntegral) $ unfoldl divs n What's going on in `toEnum . fromIntegral` is that a remainder (either 0 or 1 - it blows up for anything else) is being converted to a Bool, with 0 mapping to False and 1 mapping to True. So `isOdd` would be a more descriptive name for `p`. -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at schmong.org Sat May 7 05:58:58 2016 From: michael at schmong.org (Michael Litchard) Date: Fri, 6 May 2016 22:58:58 -0700 Subject: [Haskell-cafe] The maths behind the Fastest Fibb In The West. In-Reply-To: <2a3845ec-d552-413c-9cc3-bc84aba7e571@googlegroups.com> References: <2a3845ec-d552-413c-9cc3-bc84aba7e571@googlegroups.com> Message-ID: Thanks for your response Erik. It appears I have not articulated my question well enough. When p is odd, why is the return value (f*(f+2*g), f^2 + g^2) as opposed to the return value of (f^2+g^2, g*(2*f-g)) What is it about the boolean value that requires two entirely seperate things to be done? On Fri, May 6, 2016 at 7:38 PM, Erik Rantapaa wrote: > > > On Friday, May 6, 2016 at 6:46:26 PM UTC-5, Michael Litchard wrote: >> >> I've been working on a project that needs a good fibonacci generator, and >> I'm to the point where can now improve upon this one: >> https://wiki.haskell.org/The_Fibonacci_sequence#Fastest_Fib_in_the_West >> >> thanks to this guy: >> https://groups.google.com/forum/#!topic/haskell-cafe/HUgbAUCvCp4 >> >> He suggested breaking up a guard into two diffeent functions, which I can >> do, but I don't know what to call them because I don't know why the >> operations are different. I'm referring to this section: >> >> fib' (f, g) p >> | p = (f*(f+2*g), f^2 + g^2) >> | otherwise = (f^2+g^2, g*(2*f-g)) >> >> I'd like to know the reason why each guard does two entirely different things, so I know what to call the functions when I seperate them out. >> >> > Clearly `p` is a Bool, and it comes from the expression: > > map (toEnum . fromIntegral) $ unfoldl divs n > > What's going on in `toEnum . fromIntegral` is that a remainder (either 0 > or 1 - it blows up for anything else) is being converted to a Bool, with 0 > mapping to False and 1 mapping to True. So `isOdd` would be a more > descriptive name for `p`. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From erantapaa at gmail.com Sat May 7 07:37:33 2016 From: erantapaa at gmail.com (Erik Rantapaa) Date: Sat, 7 May 2016 00:37:33 -0700 (PDT) Subject: [Haskell-cafe] The maths behind the Fastest Fibb In The West. In-Reply-To: References: <2a3845ec-d552-413c-9cc3-bc84aba7e571@googlegroups.com> Message-ID: <2dfa6f1e-9354-458b-a886-df46b49dbee1@googlegroups.com> On Saturday, May 7, 2016 at 12:59:10 AM UTC-5, Michael Litchard wrote: > > Thanks for your response Erik. It appears I have not articulated my > question well enough. > When p is odd, why is the return value > > (f*(f+2*g), f^2 + g^2) > > as opposed to the return value of > > (f^2+g^2, g*(2*f-g)) > > What is it about the boolean value that requires two entirely seperate things to be done? > > The algorithm is based on the following Fibonacci identities (which hopefully I've recited correctly): F_{2n} = F_n^2 + F_{n+1}^2 F_{2n+1) = F_{n+1}*(2*F_n + F_{n+1}) and there is a similar formula for F_{2n-1} in terms of F_n and F_{n+1}. So given a pair of consecutive Fibonacci numbers, (F_n, F_{n+1}), we can use these formulas to compute another pair of consecutive Fibonacci's, either (F_{2n-1}, F_2n) or (F_2n, F_{2n+1}). This is what fib' is doing -- f and g are a pair of consecutive Fibonacci's and it returns one of these new pairs based on whatever p is. So, starting from the pair (F_1, F_2) we have to figure out the sequence of p's which will get us to our target F_n, and that appears to be related to the binary representation of n. > On Fri, May 6, 2016 at 7:38 PM, Erik Rantapaa > wrote: > >> >> >> On Friday, May 6, 2016 at 6:46:26 PM UTC-5, Michael Litchard wrote: >>> >>> I've been working on a project that needs a good fibonacci generator, >>> and I'm to the point where can now improve upon this one: >>> https://wiki.haskell.org/The_Fibonacci_sequence#Fastest_Fib_in_the_West >>> >>> >>> thanks to this guy: >>> https://groups.google.com/forum/#!topic/haskell-cafe/HUgbAUCvCp4 >>> >>> He suggested breaking up a guard into two diffeent functions, which I >>> can do, but I don't know what to call them because I don't know why the >>> operations are different. I'm referring to this section: >>> >>> fib' (f, g) p >>> | p = (f*(f+2*g), f^2 + g^2) >>> | otherwise = (f^2+g^2, g*(2*f-g)) >>> >>> I'd like to know the reason why each guard does two entirely different things, so I know what to call the functions when I seperate them out. >>> >>> >> Clearly `p` is a Bool, and it comes from the expression: >> >> map (toEnum . fromIntegral) $ unfoldl divs n >> >> What's going on in `toEnum . fromIntegral` is that a remainder (either 0 >> or 1 - it blows up for anything else) is being converted to a Bool, with 0 >> mapping to False and 1 mapping to True. So `isOdd` would be a more >> descriptive name for `p`. >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jo at durchholz.org Sat May 7 09:17:07 2016 From: jo at durchholz.org (Joachim Durchholz) Date: Sat, 7 May 2016 11:17:07 +0200 Subject: [Haskell-cafe] Storing big datasets In-Reply-To: <20160507002703.4378706.29272.3461@amok.cc> References: <572CFE82.7070209@gmail.com> <20160507002703.4378706.29272.3461@amok.cc> Message-ID: <572DB293.9040101@durchholz.org> Am 07.05.2016 um 02:27 schrieb Lana Black: > Hi Mikhail, > > Have you considered external database engines? I suppose you could benefit from using Redis in your case. Wikipedia says that while Redis can use the disk as "virtual memory", that feature is deprecated, so it definitely expects to keep the whole dataset in memory. Which kind of defeats the whole point for Mikhail. sqlite comes to mind. HDBC claims to have a driver for it, and it's linked into the application so there would be no additional setup required. If Mikhail already has another database in his application, the setup cost is already paid for, and he might want to check whether that's fast enough for his purposes. I'd expect postgresql or mysql to be too slow, but H2 to work just fine. Of course that's just expectations, so testing would be needed. Regards, Jo From dct25-561bs at mythic-beasts.com Sat May 7 10:48:27 2016 From: dct25-561bs at mythic-beasts.com (David Turner) Date: Sat, 7 May 2016 11:48:27 +0100 Subject: [Haskell-cafe] Storing big datasets In-Reply-To: <572CFE82.7070209@gmail.com> References: <572CFE82.7070209@gmail.com> Message-ID: Btrees are good for storing data on disk. And something like postgres is an extremely efficient implementation of a btree supporting atomic updates and the like. I'd use that! On 6 May 2016 21:29, "Mikhail Volkhov" wrote: > Hi! > > I'm using ACID package as main database -- it's simple and... ACID > (which is cool of course). > > So now I need to store up to ~30GB of data in a single data structure > (!) that will be constantly updated (some kind of a huge tree set). > Here's a question -- how to operate that big structure? > 1. It doesn't even fit in RAM > 2. It should be updated atomically and frequently (every 10 seconds up > to 500 elements out of 10^7). > 3. What structures should I use? I'd like to store up to 10^6~10^7 some > simple elements there too, that will be gigabytes of data. So it seems > to me I can't use Data.Set. > > Thanks for any ideas! > -- > Volkhov Mikhail > M3#38 ITMO study group 17' > Computer Technologies Department > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From volhovm.cs at gmail.com Sat May 7 10:58:25 2016 From: volhovm.cs at gmail.com (Mikhail Volkhov) Date: Sat, 7 May 2016 13:58:25 +0300 Subject: [Haskell-cafe] Storing big datasets In-Reply-To: <572DB293.9040101@durchholz.org> References: <572CFE82.7070209@gmail.com> <20160507002703.4378706.29272.3461@amok.cc> <572DB293.9040101@durchholz.org> Message-ID: <572DCA51.4080903@gmail.com> First, about external database engines -- I don't really understand how should I store my own set datatype (let's say it's a red-black tree with some extra information in nodes, something like that) in the key-value db. No idea. And yes, what about Redis, it's not supposed to work with sizes more than RAM can hold. Currently it's not the problem to switch application db. I'll check your solutions (sqlite/HDBC/postgre/H2). Thanks! On 05/07/2016 12:17 PM, Joachim Durchholz wrote: > Am 07.05.2016 um 02:27 schrieb Lana Black: >> Hi Mikhail, >> >> Have you considered external database engines? I suppose you could >> benefit from using Redis in your case. > > Wikipedia says that while Redis can use the disk as "virtual memory", > that feature is deprecated, so it definitely expects to keep the whole > dataset in memory. Which kind of defeats the whole point for Mikhail. > > sqlite comes to mind. HDBC claims to have a driver for it, and it's > linked into the application so there would be no additional setup required. > > If Mikhail already has another database in his application, the setup > cost is already paid for, and he might want to check whether that's fast > enough for his purposes. > I'd expect postgresql or mysql to be too slow, but H2 to work just fine. > Of course that's just expectations, so testing would be needed. > > Regards, > Jo > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe -- Volkhov Mikhail M3#38 ITMO study group 17' Computer Technologies Department From imantc at gmail.com Sat May 7 11:13:06 2016 From: imantc at gmail.com (Imants Cekusins) Date: Sat, 7 May 2016 13:13:06 +0200 Subject: [Haskell-cafe] Storing big datasets In-Reply-To: <572DCA51.4080903@gmail.com> References: <572CFE82.7070209@gmail.com> <20160507002703.4378706.29272.3461@amok.cc> <572DB293.9040101@durchholz.org> <572DCA51.4080903@gmail.com> Message-ID: neo4j may be a good fit for trees. it may be necessary to store large blobs of data in another db. ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From jo at durchholz.org Sat May 7 12:44:48 2016 From: jo at durchholz.org (Joachim Durchholz) Date: Sat, 7 May 2016 14:44:48 +0200 Subject: [Haskell-cafe] Storing big datasets In-Reply-To: References: <572CFE82.7070209@gmail.com> Message-ID: <572DE340.2060905@durchholz.org> Am 07.05.2016 um 12:48 schrieb David Turner: > Btrees are good for storing data on disk. And something like postgres is an > extremely efficient implementation of a btree supporting atomic updates and > the like. I'd use that! The original question was about standard hardware (i.e. still including rotating rust) and ~50 updates/second. I'd assume that that's doable with an ACID-compliant DB on standard hardware, though it does not leave room for inefficiencies so you need to know what you're doing in SQL. On a later update, he corrected the specs to 1,000-2,000 updates/second, and I believe that it's impossible to do that on a standard single-HDD. I don't know whether Mikhail considers SSDs standard configuration. Now transaction rates aren't the same as write rates. If he can batch multiple writes in one transaction, Postgresql or any other RDBMS might actually work. From volhovm.cs at gmail.com Sat May 7 13:08:41 2016 From: volhovm.cs at gmail.com (Mikhail Volkhov) Date: Sat, 7 May 2016 16:08:41 +0300 Subject: [Haskell-cafe] Storing big datasets In-Reply-To: <572DE340.2060905@durchholz.org> References: <572CFE82.7070209@gmail.com> <572DE340.2060905@durchholz.org> Message-ID: <572DE8D9.7030900@gmail.com> > On a later update, he corrected the specs to 1,000-2,000 updates/second, > and I believe that it's impossible to do that on a standard single-HDD. > I don't know whether Mikhail considers SSDs standard configuration. Yes, I suppose SSD is standard configuration -- it costs less than >32Gb of RAM and it can be installed on any device while it's the problem with extra RAM on laptops > Now transaction rates aren't the same as write rates. If he can batch > multiple writes in one transaction, Postgresql or any other RDBMS might > actually work. Thank you, will look into these approaches. -- Volkhov Mikhail M3#38 ITMO study group 17', CT Department From dct25-561bs at mythic-beasts.com Sat May 7 14:42:23 2016 From: dct25-561bs at mythic-beasts.com (David Turner) Date: Sat, 7 May 2016 15:42:23 +0100 Subject: [Haskell-cafe] Storing big datasets In-Reply-To: <572DE340.2060905@durchholz.org> References: <572CFE82.7070209@gmail.com> <572DE340.2060905@durchholz.org> Message-ID: On 7 May 2016 13:45, "Joachim Durchholz" wrote: > > Am 07.05.2016 um 12:48 schrieb David Turner: >> >> Btrees are good for storing data on disk. And something like postgres is an >> extremely efficient implementation of a btree supporting atomic updates and >> the like. I'd use that! > > > The original question was about standard hardware (i.e. still including rotating rust) and ~50 updates/second. > I'd assume that that's doable with an ACID-compliant DB on standard hardware, though it does not leave room for inefficiencies so you need to know what you're doing in SQL. > > On a later update, he corrected the specs to 1,000-2,000 updates/second, and I believe that it's impossible to do that on a standard single-HDD. I don't know whether Mikhail considers SSDs standard configuration. > > Now transaction rates aren't the same as write rates. If he can batch multiple writes in one transaction, Postgresql or any other RDBMS might actually work. Thousands of transactions per second is getting into needs-clever-optimisation territory if it can't be done in RAM, but it's not that tricky. Postgres will batch transactions for you: see for instance http://pgeoghegan.blogspot.co.uk/2012/06/towards-14000-write-transactions-on-my.html?m=1 Cheers, > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe -------------- next part -------------- An HTML attachment was scrubbed... URL: From jo at durchholz.org Sat May 7 21:11:57 2016 From: jo at durchholz.org (Joachim Durchholz) Date: Sat, 7 May 2016 23:11:57 +0200 Subject: [Haskell-cafe] Storing big datasets In-Reply-To: References: <572CFE82.7070209@gmail.com> <572DE340.2060905@durchholz.org> Message-ID: <572E5A1D.7050306@durchholz.org> Am 07.05.2016 um 16:42 schrieb David Turner: > Thousands of transactions per second is getting into > needs-clever-optimisation territory if it can't be done in RAM, but it's > not that tricky. Postgres will batch transactions for you: see for instance > http://pgeoghegan.blogspot.co.uk/2012/06/towards-14000-write-transactions-on-my.html?m=1 Well, actually it is - that particular guy maintains 14,000 transactions per second, but with benchmarks that may or may not transfer to Mikhail's scenario, and with a quite high-end 7,200 RPM HDD which may or may not fit his definition of standard hardware. That said, these results are still pretty impressive. Regards, Jo BTW please "reply to list", replying directly and CC'ing to the list means I have to manually copy/paste the list address to answer. From lanablack at amok.cc Sun May 8 01:34:08 2016 From: lanablack at amok.cc (Lana Black) Date: Sun, 8 May 2016 01:34:08 +0000 Subject: [Haskell-cafe] Storing big datasets In-Reply-To: <572DB293.9040101@durchholz.org> References: <572CFE82.7070209@gmail.com> <20160507002703.4378706.29272.3461@amok.cc> <572DB293.9040101@durchholz.org> Message-ID: <20160508013408.GA31856@rhea> On 11:17 Sat 07 May , Joachim Durchholz wrote: > Am 07.05.2016 um 02:27 schrieb Lana Black: > > Hi Mikhail, > > > > Have you considered external database engines? I suppose you could benefit from using Redis in your case. > > Wikipedia says that while Redis can use the disk as "virtual memory", > that feature is deprecated, so it definitely expects to keep the whole > dataset in memory. Which kind of defeats the whole point for Mikhail. I believe we're talking about different things here. This page [1] says that disk persistence is a standard feature in redis. Furthermore, my employer uses redis as a storage backend for raw video, and it works just fine. But yes, redis might not be the best choice depending on what data Mikhail works with. > sqlite comes to mind. HDBC claims to have a driver for it, and it's > linked into the application so there would be no additional setup required. > > If Mikhail already has another database in his application, the setup > cost is already paid for, and he might want to check whether that's fast > enough for his purposes. > I'd expect postgresql or mysql to be too slow, but H2 to work just fine. > Of course that's just expectations, so testing would be needed. It is certainly possible to get 2k requests per second with postgresql [2] on a fairly limited hardware if network latency is taken out of the picture. Again this heavily depends on the kind of data and other conditions. [1] http://redis.io/topics/persistence [2] https://gist.github.com/chanks/7585810 From jo at durchholz.org Sun May 8 07:41:49 2016 From: jo at durchholz.org (Joachim Durchholz) Date: Sun, 8 May 2016 09:41:49 +0200 Subject: [Haskell-cafe] Storing big datasets In-Reply-To: <20160508013408.GA31856@rhea> References: <572CFE82.7070209@gmail.com> <20160507002703.4378706.29272.3461@amok.cc> <572DB293.9040101@durchholz.org> <20160508013408.GA31856@rhea> Message-ID: <572EEDBD.1080501@durchholz.org> Am 08.05.2016 um 03:34 schrieb Lana Black: > On 11:17 Sat 07 May , Joachim Durchholz wrote: >> Am 07.05.2016 um 02:27 schrieb Lana Black: >>> Hi Mikhail, >>> >>> Have you considered external database engines? I suppose you could benefit from using Redis in your case. >> >> Wikipedia says that while Redis can use the disk as "virtual memory", >> that feature is deprecated, so it definitely expects to keep the whole >> dataset in memory. Which kind of defeats the whole point for Mikhail. > > I believe we're talking about different things here. This page [1] says > that disk persistence is a standard feature in redis. > [1] http://redis.io/topics/persistence I see. Seems like WP got something wrong here. Actually the claims look quite nice, even though I'd want to verify these before actually relying on them as usual with claims :-) > It is certainly possible to get 2k requests per second with postgresql [2] > on a fairly limited hardware if network latency is taken out of the picture. > Again this heavily depends on the kind of data and other conditions. > > [2] https://gist.github.com/chanks/7585810 Ah, that's about scaling up under concurrent load. Mikhail's use case does not have multiple processes per data instance. It's an interesting data point though. I've been hearing figures of "a few hundred transactions per second, max, unless you have dedicated hardware", but now I'm wondering how things might work out in a single-threading scenario. It could easily be faster, though it could also easily be slower because the engine can't parallelize work. I have to admit I have no idea how this would turn out. Regards, Jo From ollie at ocharles.org.uk Sun May 8 11:19:09 2016 From: ollie at ocharles.org.uk (Oliver Charles) Date: Sun, 08 May 2016 11:19:09 +0000 Subject: [Haskell-cafe] Could Haddock export documentation with type family applications normalised? In-Reply-To: <1462272204.7888.21.camel@joachim-breitner.de> References: <1462272204.7888.21.camel@joachim-breitner.de> Message-ID: On Tue, May 3, 2016 at 11:43 AM Joachim Breitner wrote: > Hi, > > Am Dienstag, den 03.05.2016, 11:20 +0100 schrieb Oliver Charles: > > Has this been discussed before? If not, how do people feel about > > this? > > there will be people who want normalised types, and others will want > the original types, so I expect that we will not agree on one > particular behavior. > > But since the usual scheme is that haddock should print what is written > in the source, if there is something, then the InstanceSigs extension > should help you: > https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/type-cl > ass-extensions.html#instance-sigs > > > Have you checked if haddock is maybe already paying attention to such > signatures? > Thanks for the type Joachim, I hadn't thought about that extension. I'll give that a try and see if that gives me the output I desire. Ollie -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan.miljenovic at gmail.com Sun May 8 12:15:41 2016 From: ivan.miljenovic at gmail.com (Ivan Lazar Miljenovic) Date: Sun, 8 May 2016 22:15:41 +1000 Subject: [Haskell-cafe] Applying a Constraint to a Proxy'd type Message-ID: I'm not sure if it's possible (and I have an alternate method of doing this so it isn't strictly speaking _necessary_, but would make the code cleaner if I can), but I would like to convert a "value" of kind (k -> Constraint) into one of kind (Proxy k -> Constraint). I can achieve this using a type family (note: I've also made this polymorphic in terms of the Proxy type used, but that isn't necessary): > type family LiftConstraint_ c pa :: Constraint where > LiftConstraint_ c (proxy a) = c a > LiftConstraint_ c pa = () ~ Bool -- A nonsensical failing Constraint value which has the problem that it can't be partially applied (which I also need). This can be wrapped up in a typeclass: > class (LiftConstraint_ c pa) => LiftConstraint c pa > instance (LiftConstraint_ c pa) => LiftConstraint c pa The problem with this is that if I try and use it somewhere that - having already a type of kind (c :: * -> Constraint) from the environment - that expects a function of type (forall a. (c a) => a -> b) with a fixed "b" value, then trying to use something like this function prevents it from working (for the purposes of argument, assume the old specification of Num that had an Eq superclass; this is the way I can produce the smallest example): > fn :: forall pn. (LiftConstraint Num (Proxy n)) => Proxy n -> Bool > fn = join (==) . asProxyTypeOf 0 The resulting error message is: "Could not deduce (a ~ Proxy n0) ..." This occurs even if I make the type of fn polymorphic in terms of the proxy type or if I make LiftConstraint_ specific. Note that the error goes away if I make the definition to be "fn = const True"; it's only if I try and _use_ the proxy value. I've tried defining and using an IsProxy type family + class but that fails to the same basic problem: it can't tell that the provided value can be pulled apart to get what's in the Proxy. Any ideas? -- Ivan Lazar Miljenovic Ivan.Miljenovic at gmail.com http://IvanMiljenovic.wordpress.com From miguel.a.santos.l at gmail.com Sun May 8 16:04:17 2016 From: miguel.a.santos.l at gmail.com (Miguel A. Santos) Date: Sun, 8 May 2016 12:04:17 -0400 Subject: [Haskell-cafe] Automatic differentiation (AD) with respect to list of matrices in Haskell Message-ID: I am trying to understand how can I use Numeric.AD (automatic differentiation) in Haskell. I defined a simple matrix type and a scalar function taking an array and two matrices as arguments. I want to use AD to get the gradient of the scoring function with respect to both matrices, but I'm running into compilation problems. Here is the code: ------------------------------- {-# LANGUAGE DeriveTraversable, DeriveFunctor, DeriveFoldable #-}import Numeric.AD.Mode.Reverse as Rimport Data.Traversable as Timport Data.Foldable as F --- Non-linear function on "vectors" logistic x = 1.0 / (1.0 + exp(-x) ) phi v = map logistic v phi' (x:xs) = x : (phi xs) --- dot product dot u v = foldr (+) 0 $ zipWith (*) u v --- simple matrix typedata Matrix a = M [[a]] deriving (Eq,Show,Functor,F.Foldable,T.Traversable) --- action of a matrix on a vector mv _ [] = [] mv (M []) _ = [] mv ( M m ) v = ( dot (head m) v ) : (mv (M (tail m)) v ) --- two matrices mbW1 = M $ [[1,0,0],[-1,5,1],[1,2,-3]] mbW2 = M $ [[0,0,0],[1,3,-1],[-2,4,6]] --- two different scoring functions sc1 v m = foldr (+) 0 $ (phi' . (mv m) ) v sc2 :: Floating a => [a] -> [Matrix a] -> a sc2 v [m1, m2] = foldr (+) 0 $ (phi' . (mv m2) . phi' . (mv m1) ) v strToInt = read :: String -> Double strLToIntL = map strToInt--- testing main = do putStrLn $ "mbW1:" ++ (show mbW1) putStrLn $ "mbW2:" ++ (show mbW2) rawInput <- readFile "/dev/stdin" let xin= strLToIntL $ lines rawInput putStrLn "sc xin mbW1" print $ sc1 xin mbW1 --- ok. = putStrLn "grad (sc1 xin) mbW1" print $ grad ( sc1 xin) mbW1 -- yields an error: expects xin [Reverse s Double] instead of [Double] putStrLn "grad (sc1 [3,5,7]) mbW1" print $ grad ( sc1 [3,5,7]) mbW1 --- ok. = putStrLn "sc2 xin [mbW1,mbW2]" print $ sc2 xin [mbW1, mbW2] putStrLn "grad (sc2 [3,5,7) [mbW1,mbW2]" print $ grad ( sc2 [3,5,7]) [mbW1, mbW2] --- Error: see text -------------------------------- The last line (grad on sc2) gives the following error: --------------------------------- Couldn't match type ?Reverse s (Matrix Double)? with ?Matrix (Reverse s (Matrix Double))? Expected type: [Reverse s (Matrix Double)] -> Reverse s (Matrix Double) Actual type: [Matrix (Reverse s (Matrix Double))] -> Reverse s (Matrix Double) In the first argument of ?grad?, namely ?(sc2 [3, 5, 7])? In the second argument of ?($)?, namely ?grad (sc2 [3, 5, 7]) [mbW1, mbW2]? --------------------------------- I don't understand where the "Matrix of Matrix" in the actual type seen comes from. I'm feeding the grad with a curried version of sc2, making it a function on a list of Matrix. Commenting out the two offending lines runs without problem, i.e., the first gradient works and is correctly calculated (I'm feeding [1,2,3] as input to the program): ------------------- mbW1:M [[1.0,0.0,0.0],[-1.0,5.0,1.0],[1.0,2.0,-3.0]] mbW2:M [[0.0,0.0,0.0],[1.0,3.0,-1.0],[-2.0,4.0,6.0]] sc1 xin mbW11232.0179800657874893 grad (sc1 [3,5,7]) mbW1 M [[3.0,5.0,7.0],[7.630996942126885e-13,1.2718328236878141e-12,1.7805659531629398e-12],[1.0057130122694228e-3,1.6761883537823711e-3,2.3466636952953197e-3]] sc2 xin [mbW1,mbW2]1.8733609463863194 ------------------- Both errors are an issue. I want to take the gradient of any such sc2 scoring function, depending on an array of matrices, evaluated at any given "point" xin. Clearly, I'm not yet understanding the AD library well enough. Any help would be appreciated. -- Public key ID: E8FE60D7 Public key server: see, e.g., hkp://keys.gnupg.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From moritz.kiefer at purelyfunctional.org Sun May 8 17:14:25 2016 From: moritz.kiefer at purelyfunctional.org (Moritz Kiefer) Date: Sun, 08 May 2016 19:14:25 +0200 Subject: [Haskell-cafe] Automatic differentiation (AD) with respect to list of matrices in Haskell In-Reply-To: References: Message-ID: <878tzkwjym.fsf@purelyfunctional.org> There are two orthogonal errors going on here: 1. You need to use auto to embed constants. See the comments at the code below on how to use it. 2. You need to wrap [Matrix a] in a newtype. grad requires you to provide a function f a -> a, however sc2 _ has the type [Matrix a] -> a so if you replace [] by f you end up with f (Matrix a) -> a which results in the error you?re seeing. Miguel A. Santos writes: > mv _ [] = [] > mv (M []) _ = [] > mv ( M m ) v = ( dot (head m) v ) : (mv (M (tail m)) v ) > --- two matrices You need explicit type annotations to make this polymorphic here because of the monomorphism restriction. mbW1 :: Num a => Matrix a > mbW1 = M $ [[1,0,0],[-1,5,1],[1,2,-3]] > mbW2 = M $ [[0,0,0],[1,3,-1],[-2,4,6]] > --- two different scoring functions -- Provide a type signature and map auto over the constants sc1 :: (Floating b, Mode b) => [Scalar b] -> Matrix b -> b sc1 v m = foldr (+) 0 $ (phi' . (mv m) ) (map auto v) -- Provide a type signature, use auto and use the newtype newtype MatrixList a = MatrixList [Matrix a] deriving (Functor,Foldable,Traversable) sc2 :: (Floating a,Mode a) => [Scalar a] -> MatrixList a -> a sc2 v [m1, m2] = foldr (+) 0 $ (phi' . (mv m2) . phi' . (mv m1) ) (map auto v) > strToInt = read :: String -> Double > strLToIntL = map strToInt--- testing > main = do > putStrLn $ "mbW1:" ++ (show mbW1) > putStrLn $ "mbW2:" ++ (show mbW2) > rawInput <- readFile "/dev/stdin" > let xin= strLToIntL $ lines rawInput > putStrLn "sc xin mbW1" -- That needs an explicit type annotation because mbW1 is polymorphic print $ sc1 xin (mbW1 :: Matrix Double) --- ok. = > putStrLn "grad (sc1 xin) mbW1" > print $ grad ( sc1 xin) mbW1 -- yields an error: expects xin > [Reverse s Double] instead of [Double] > putStrLn "grad (sc1 [3,5,7]) mbW1" > print $ grad ( sc1 [3,5,7]) mbW1 --- ok. = > putStrLn "sc2 xin [mbW1,mbW2]" > print $ sc2 xin [mbW1, mbW2] > putStrLn "grad (sc2 [3,5,7) [mbW1,mbW2]" -- Use the newtype defined above print $ grad ( sc2 [3,5,7]) (MatrixList [mbW1, mbW2]) --- Error: see text Also as a general recommendation, write your type signatures explicitely at least for top level definitions. Cheers Moritz -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 818 bytes Desc: not available URL: From vogt.adam at gmail.com Sun May 8 21:15:07 2016 From: vogt.adam at gmail.com (adam vogt) Date: Sun, 8 May 2016 17:15:07 -0400 Subject: [Haskell-cafe] Applying a Constraint to a Proxy'd type In-Reply-To: References: Message-ID: Hi Ivan, When I compile your file with -fprint-explicit-kinds (which is very helpful to make sense of code using -XPolyKinds), the type error includes an inferred type like > (LiftConstraint * * EqNum (Proxy k n)) but if you look at the kind of LiftConstraint: > LiftConstraint :: (k1 -> Constraint) -> k2 -> Constraint You need the k1 to be equal to the k that's inside the Proxy, but ghc decides that the k1 and k2 are * early on, and then cannot change that decision after choosing an equation for LiftConstraint_. One solution is to restrict the kind of what's inside the Proxy, say by adding (n :: *) in the type signature for fn. I think a general rule for poly-kinded proxies is that you should "pattern match" on them in the class method signature and not in the instance heads (or the equivalent using other language features). In your case it would involve changing LiftConstraint etc. so that you could write: > fn :: LiftConstraint Num n => Proxy n -> Bool But then LiftConstraint_ can't have it's second equation. I think your problem comes up with a smaller type function: > type family UnProxy x :: k where UnProxy (Proxy x) = x You could say that 'k' could be determined by what is inside Proxy. But ghc depends on the caller of UnProxy to decide what the 'k' is and complains when it guessed wrong instead. The type constructor Proxy is more like Dynamic than Maybe: `(fromDynamic . toDyn) :: (Typeable a, Typeable b) => a -> Maybe b` probably ought to have type `Typeable a => a -> Maybe a`, but it doesn't in the same way that this fails without an additional kind signature: > type BadId x = UnProxy (Proxy x) > type SillyId (x :: k) = UnProxy (Proxy x) :: k Hope this helps. Regards, Adam On Sun, May 8, 2016 at 8:15 AM, Ivan Lazar Miljenovic < ivan.miljenovic at gmail.com> wrote: > I'm not sure if it's possible (and I have an alternate method of doing > this so it isn't strictly speaking _necessary_, but would make the > code cleaner if I can), but I would like to convert a "value" of kind > (k -> Constraint) into one of kind (Proxy k -> Constraint). > > I can achieve this using a type family (note: I've also made this > polymorphic in terms of the Proxy type used, but that isn't > necessary): > > > type family LiftConstraint_ c pa :: Constraint where > > LiftConstraint_ c (proxy a) = c a > > LiftConstraint_ c pa = () ~ Bool -- A nonsensical failing > Constraint value > > which has the problem that it can't be partially applied (which I also > need). This can be wrapped up in a typeclass: > > > class (LiftConstraint_ c pa) => LiftConstraint c pa > > instance (LiftConstraint_ c pa) => LiftConstraint c pa > > The problem with this is that if I try and use it somewhere that - > having already a type of kind (c :: * -> Constraint) from the > environment - that expects a function of type (forall a. (c a) => a -> > b) with a fixed "b" value, then trying to use something like this > function prevents it from working (for the purposes of argument, > assume the old specification of Num that had an Eq superclass; this is > the way I can produce the smallest example): > > > fn :: forall pn. (LiftConstraint Num (Proxy n)) => Proxy n -> Bool > > fn = join (==) . asProxyTypeOf 0 > > The resulting error message is: "Could not deduce (a ~ Proxy n0) ..." > > This occurs even if I make the type of fn polymorphic in terms of the > proxy type or if I make LiftConstraint_ specific. Note that the error > goes away if I make the definition to be "fn = const True"; it's only > if I try and _use_ the proxy value. > > I've tried defining and using an IsProxy type family + class but that > fails to the same basic problem: it can't tell that the provided value > can be pulled apart to get what's in the Proxy. > > Any ideas? > > -- > Ivan Lazar Miljenovic > Ivan.Miljenovic at gmail.com > http://IvanMiljenovic.wordpress.com > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From miguel.a.santos.l at gmail.com Sun May 8 21:40:08 2016 From: miguel.a.santos.l at gmail.com (Miguel A. Santos) Date: Sun, 8 May 2016 17:40:08 -0400 Subject: [Haskell-cafe] Automatic differentiation (AD) with respect to list of matrices in Haskell In-Reply-To: References: <878tzkwjym.fsf@purelyfunctional.org> <877ff4wgng.fsf@purelyfunctional.org> Message-ID: Awesome! Lots of new info! And more importantly, I got it to work. > > I still need to work on it a bit more, but things seems to be getting > clearer. > > On Sun, May 8, 2016 at 2:25 PM, Moritz Kiefer < > moritz.kiefer at purelyfunctional.org> wrote: > >> >> Miguel A. Santos writes: >> >> > Thanks a lot for your quick answer. >> > >> > First, I can't get your modifications through: What are Scalar & Mode? >> ghc >> > says type/class not in scope. >> >> Oh sorry you need to import Numeric.AD for that. Mode is a typeclass >> with an associated type called Scalar. You can just think of it as some >> magic that allows you to use constants in your function. >> >> > Yes. I figured out as well. I was only importing its Mode.Reverse as R. > > > >> > Some more questions to help me understand your suggestions below. >> > >> > >> > On Sun, May 8, 2016 at 1:14 PM, Moritz Kiefer < >> > moritz.kiefer at purelyfunctional.org> wrote: >> > >> >> >> >> There are two orthogonal errors going on here: >> >> >> >> 1. You need to use auto to embed constants. See the comments at the >> code >> >> below on how to use it. >> >> >> >> Ah, that solves indeed the first problem. Thanks! >> > >> > >> >> 2. You need to wrap [Matrix a] in a newtype. grad requires you to >> >> provide a function f a -> a, however sc2 _ has the type [Matrix a] -> a >> >> so if you replace [] by f you end up with f (Matrix a) -> a which >> >> results in the error you?re seeing. >> >> >> > >> > I've problems following you here. For example this is legit and works >> > grad (\[x,y] -> x^2y^3) [5,7] >> > >> > That is, grad here is taking a function f [a,a] -> a. That seems to >> work as >> > well with sc1 in my example: I do get the rigth gradient. >> >> That function has type [a] -> a which can be rewritten as [] a -> a and >> if you unify [] and f you have f a >> -> a which is exactly what you need. >> >> However in sc2 you have a function of type [Matrix a] -> a which can be >> rewritten as [] (Matrix a) -> a and if you unify f and [] you end up >> with f (Matrix a) -> a. However Matrix a and a are not the same type so >> you get an error. >> >> > I got confused by the expression "[the] function f a -> a": I though the > word 'function' was referring to the symbol 'f'. > > Yet, I still can't follow things completely...uhm, issuing :type grad in > ghci I get > grad > :: (Num a, Traversable f) => > (forall s. > Data.Reflection.Reifies s Numeric.AD.Internal.Reverse.Tape => > f (Numeric.AD.Internal.Reverse.Reverse s a) > -> Numeric.AD.Internal.Reverse.Reverse s a) > -> f a -> f a > > which I'd say could be simplified to > grad :: Num a => ( f Reverse s a -> Reverse s a) -> f a -> f a > > Now, It's not only that I don't see your "grad expects a 'f a -> a' ", but > I don't even see how something like grad (\[x,y]-> x*y) [2,3] fits...or do > I? The notation 'f' seems was misleading me. I'd say what's important is > its type, name Traversable f. [] seems to fit there, isn't? So the first > argument of grad more or less would be what you were referring to ( f a -> > a) , the second it the point to calculate the gradient at (of course a [a], > or, [] a, hence, f a) and it does yield a "vector" (on paper). > Interestingly, its implementation means that grad's output is the same type > the input of the function we want to take its gradient of. > > I think it starts making sense to me now. > > >> >> >> Miguel A. Santos writes: >> >> >> >> > mv _ [] = [] >> >> > mv (M []) _ = [] >> >> > mv ( M m ) v = ( dot (head m) v ) : (mv (M (tail m)) v ) >> >> > --- two matrices >> >> >> >> You need explicit type annotations to make this polymorphic here >> because >> >> of the monomorphism >> >> restriction. >> >> >> >> >> > Just for the sake of learning how to use that jargon in this context: >> > which/what is that monomorphism restriction are you referring to? Also, >> > when you say my mbW1 is polymorphic, do you mean, given my definition of >> > it, ghc cannot adscribe it one _unique_ type signature, but that will >> vary >> > depending on the context? >> >> I?m going to refer you to the haskell report [1] for information on the >> monomorphism restriction. By polymorphic I?m referring to the choice of >> a which is now left open. >> >> Thanks!! > > >> >> mbW1 :: Num a => Matrix a >> >> > mbW1 = M $ [[1,0,0],[-1,5,1],[1,2,-3]] >> >> > mbW2 = M $ [[0,0,0],[1,3,-1],[-2,4,6]] >> >> > --- two different scoring functions >> >> >> >> -- Provide a type signature and map auto over the constants >> >> sc1 :: (Floating b, Mode b) => [Scalar b] -> Matrix b -> b >> >> sc1 v m = foldr (+) 0 $ (phi' . (mv m) ) (map auto v) >> >> >> > >> >> -- Provide a type signature, use auto and use the newtype >> >> newtype MatrixList a = MatrixList [Matrix a] deriving >> >> (Functor,Foldable,Traversable) >> >> >> >> sc2 :: (Floating a,Mode a) => [Scalar a] -> MatrixList a -> a >> >> sc2 v [m1, m2] = foldr (+) 0 $ (phi' . (mv m2) . phi' . (mv m1) ) (map >> >> auto v) >> >> >> >> > strToInt = read :: String -> Double >> >> > strLToIntL = map strToInt--- testing >> >> > main = do >> >> > putStrLn $ "mbW1:" ++ (show mbW1) >> >> > putStrLn $ "mbW2:" ++ (show mbW2) >> >> > rawInput <- readFile "/dev/stdin" >> >> > let xin= strLToIntL $ lines rawInput >> >> > putStrLn "sc xin mbW1" >> >> >> >> -- That needs an explicit type annotation because mbW1 is polymorphic >> >> print $ sc1 xin (mbW1 :: Matrix Double) --- ok. = >> >> >> >> uhm...but it doesn't seem to give any problem, especially not after >> using >> > auto...I've still problems getting an intuition on when ghc does need >> "my >> > help" and when it can walk on it own. >> >> Hm maybe you don?t need it after all. I thought I got an error >> locally. Sorry I don?t have any good tip on how to get an >> intuition. I add them when I?m unsure about the type of something myself >> to help me to figure it out and when I get an error. >> >> >> > putStrLn "grad (sc1 xin) mbW1" >> >> > print $ grad ( sc1 xin) mbW1 -- yields an error: expects >> xin >> >> > [Reverse s Double] instead of [Double] >> >> > putStrLn "grad (sc1 [3,5,7]) mbW1" >> >> > print $ grad ( sc1 [3,5,7]) mbW1 --- ok. = >> >> > putStrLn "sc2 xin [mbW1,mbW2]" >> >> > print $ sc2 xin [mbW1, mbW2] >> >> > putStrLn "grad (sc2 [3,5,7) [mbW1,mbW2]" >> >> >> >> -- Use the newtype defined above >> >> print $ grad ( sc2 [3,5,7]) (MatrixList [mbW1, mbW2]) --- >> Error: >> >> see text >> >> >> >> Also as a general recommendation, write your type signatures >> explicitely >> >> at least for top level definitions. >> >> >> > >> > What do you mean by "top level" definitions? --again, just a side >> comment >> > to fine-tune my jargon registers. >> >> Top level definitions are the definitions in your module that are not in >> a let or where. So basically everything that?s accessible from other >> definitions outside of the current one. >> >> > I still have to learn my way through all types. Sometimes this rule makes > my life a bit too hard, specially > when I just want to quickly test some ideas, like here: logistic expects a > Floating a but if I don't make things > explicit, ghc was finding its way around my use of Num a and this Floating > requirement of the exp function. > > I'll keep this rule in mind. > > Thanks a lot!! > > Regards, > MA > PD: Forgot to reply to the list before... > > Cheers Moritz >> >> [1] https://www.haskell.org/onlinereport/decls.html#sect4.5.5 >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfsihenson at gmail.com Mon May 9 13:30:44 2016 From: jfsihenson at gmail.com (Henson) Date: Mon, 9 May 2016 10:30:44 -0300 Subject: [Haskell-cafe] Problems with function recursion in Haskell Message-ID: <57309104.3030407@gmail.com> Hi, I'm new in Haskell and I need help in recursion. That function below is returning "*** Exception: Prelude.head: empty list" and I need resolve that: execNTimes 0 [] = return() execNTimes n xs = if n<=0 || null xs then return() else do si <- getLine let s = words si l = read (s !! 1) :: Int r = read (s !! 2) :: Int if head s=="Q" then do let z = slice l r xs m = foldl lcm 1 z print (m `mod` (toInteger 1000000007)) else do let s1 = update l r xs execNTimes (n-1) s1 execNTimes (n-1) xs Anybody can me help? Thank you, Josenildo Silva From fa-ml at ariis.it Mon May 9 13:45:21 2016 From: fa-ml at ariis.it (Francesco Ariis) Date: Mon, 9 May 2016 15:45:21 +0200 Subject: [Haskell-cafe] Problems with function recursion in Haskell In-Reply-To: <57309104.3030407@gmail.com> References: <57309104.3030407@gmail.com> Message-ID: <20160509134521.GA11251@casa.casa> On Mon, May 09, 2016 at 10:30:44AM -0300, Henson wrote: > Hi, > > I'm new in Haskell and I need help in recursion. > That function below is returning "*** Exception: Prelude.head: empty list" > and > I need resolve that: > execNTimes 0 [] = return() > execNTimes n xs = if n<=0 || null xs > then return() > else do > si <- getLine > let s = words si > l = read (s !! 1) :: Int > r = read (s !! 2) :: Int > if head s=="Q" > then do > let z = slice l r xs > m = foldl lcm 1 z > print (m `mod` (toInteger 1000000007)) > else do > let s1 = update l r xs > execNTimes (n-1) s1 > execNTimes (n-1) xs > > Anybody can me help? Hello Josenildo, the error indeed tells us you are passing an empty list to the function `head`. si <- getLine let s = words si -- other lines if head s == "Q" so I suppose you are giving an empty string as input to getLine (I cannot be sure as the code doesn't compile, missing `slice` and `update`). From sumit.sahrawat.apm13 at iitbhu.ac.in Mon May 9 13:53:10 2016 From: sumit.sahrawat.apm13 at iitbhu.ac.in (Sumit Sahrawat, Maths & Computing, IIT (BHU)) Date: Mon, 9 May 2016 19:23:10 +0530 Subject: [Haskell-cafe] Problems with function recursion in Haskell In-Reply-To: <57309104.3030407@gmail.com> References: <57309104.3030407@gmail.com> Message-ID: Hi, Rather than using indexing, or using head, I recommend using pattern matching. These functions are not total, i.e. they fail to provide a valid result for some specific inputs, like head on empty list. The following is similar to replicateM from Control.Monad, you can either modify it to suit your need, or use replicateM combined with map to turn a list of Strings to a list of IO () as required by replicateM. execNTimes :: Int -> [IO ()] -> IO () execNTimes 0 [] = return () execNTimes n (x : xs) | n <= 0 = return () | otherwise = x >> execNTimes (n - 1) xs Where, the following are equivalent: a >> b == do a b Regards, Sumit On 9 May 2016 at 19:00, Henson wrote: > Hi, > > I'm new in Haskell and I need help in recursion. > That function below is returning "*** Exception: Prelude.head: empty list" > and > I need resolve that: > execNTimes 0 [] = return() > execNTimes n xs = if n<=0 || null xs > then return() > else do > si <- getLine > let s = words si > l = read (s !! 1) :: Int > r = read (s !! 2) :: Int > if head s=="Q" > then do > let z = slice l r xs > m = foldl lcm 1 z > print (m `mod` (toInteger 1000000007)) > else do > let s1 = update l r xs > execNTimes (n-1) s1 > execNTimes (n-1) xs > > Anybody can me help? > > Thank you, > Josenildo Silva > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm at memorici.de Mon May 9 13:56:08 2016 From: jm at memorici.de (Jonn Mostovoy) Date: Mon, 9 May 2016 16:56:08 +0300 Subject: [Haskell-cafe] Problems with function recursion in Haskell In-Reply-To: <57309104.3030407@gmail.com> References: <57309104.3030407@gmail.com> Message-ID: > Anybody can me help? Yes, somebody can you help, as long as 1. You provide enough information on what exactly do you want to achieve, instead of asking to fix some code; 2. You specify the input you feed to `getLine`. Top-level arguments are guarded, while `if head s=="Q"` is not. If you don't, nobody can you help. A structure of a good question ? Hello, list. I want to achieve , to do that I came up with , which is implemented . However I encounter | a problem with high-level solution >. Can you help me with that? Please note that if your goal is to do a homework it is highly unlikely that you will find any help in the list or on stackoverflow. Learning \neq passing a course. ? Kindest regards, ?? On Mon, May 9, 2016 at 4:30 PM, Henson wrote: > Hi, > > I'm new in Haskell and I need help in recursion. > That function below is returning "*** Exception: Prelude.head: empty list" > and > I need resolve that: > execNTimes 0 [] = return() > execNTimes n xs = if n<=0 || null xs > then return() > else do > si <- getLine > let s = words si > l = read (s !! 1) :: Int > r = read (s !! 2) :: Int > if head s=="Q" > then do > let z = slice l r xs > m = foldl lcm 1 z > print (m `mod` (toInteger 1000000007)) > else do > let s1 = update l r xs > execNTimes (n-1) s1 > execNTimes (n-1) xs > > Anybody can me help? > > Thank you, > Josenildo Silva > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe From slucas at dsic.upv.es Mon May 9 14:41:57 2016 From: slucas at dsic.upv.es (Salvador Lucas) Date: Mon, 9 May 2016 16:41:57 +0200 Subject: [Haskell-cafe] WST 2016 - First Call for Papers Message-ID: ========================================================================== WST 2016 - 1st Call for Papers 15th International Workshop on Termination September 5-7, 2016, Obergurgl, Austria http://cl-informatik.uibk.ac.at/events/wst-2016/ ========================================================================== The Workshop on Termination (WST) traditionally brings together, in an informal setting, researchers interested in all aspects of termination, whether this interest be practical or theoretical, primary or derived. The workshop also provides a ground for cross-fertilization of ideas from term rewriting and from the different programming language communities. The friendly atmosphere enables fruitful exchanges leading to joint research and subsequent publications. The event is held as part of CLA 2016 http://cl-informatik.uibk.ac.at/events/cla-2016/ IMPORTANT DATES: * submission June 22, 2016 * notification July 12, 2016 * final version August 3, 2016 * workshop September 5-7, 2016 TOPICS: The 15th International Workshop on Termination welcomes contributions on all aspects of termination and termination analysis. Contributions from the imperative, constraint, functional, and logic programming communities, and papers investigating applications of complexity or termination (for example in program transformation or theorem proving) are particularly welcome. Topics of interest include all aspects of termination. This includes (but is not limited to): * certification of termination and complexity proofs * challenging termination problems * comparison and classification of termination methods * complexity analysis in any domain * implementation of termination and complexity methods * implicit computational complexity * infinitary normalization * non-termination analysis and loop detection * normalization in lambda calculi * operational termination of conditional rewrite systems * ordinal notation and subrecursive hierarchies * SAT, SMT, and constraint solving for (non-)termination analysis * scalability and modularity of termination methods * termination analysis in any domain * well-founded relations and well-quasi-orders COMPETITION: There will be a live complexity and termination competition during the workshop, including time to present both the results and the tools of the participants. More details will be provided in a dedicated announcement on the competition. PROGRAM COMMITTEE: * Ugo Dal Lago Bologna University * J?rg Endrullis VU University Amsterdam * Yukiyoshi Kameyama University of Tsukuba * Salvador Lucas Universidad Polit?cnica de Valencia * Aart Middeldorp University of Innsbruck, co-chair * Andrey Rybalchenko Microsoft Research * Thomas Str?der RWTH Aachen * Ren? Thiemann University of Innsbruck, co-chair * Andreas Weiermann Ghent University INVITED SPEAKERS: * Rainer H?hnle TU Darmstadt SUBMISSION: Submissions are short papers/extended abstract which should not exceed 5 pages. There will be no formal reviewing. In particular, we welcome short versions of recently published articles and papers submitted elsewhere. The program committee checks relevance and provides additional feedback for each submission. The accepted papers will be made available electronically before the workshop. Papers should be submitted electronically via the submission page: http://www.easychair.org/conferences/?conf=wst2016 Final versions should be created using LaTeX and the LIPIcs style file http://drops.dagstuhl.de/styles/lipics/lipics-authors.tgz From yoyoyonny at gmail.com Mon May 9 15:05:09 2016 From: yoyoyonny at gmail.com (Jonne Ransijn) Date: Mon, 9 May 2016 17:05:09 +0200 Subject: [Haskell-cafe] Problems with function recursion in Haskell In-Reply-To: <57309104.3030407@gmail.com> References: <57309104.3030407@gmail.com> Message-ID: Hi Josenildo. I would personally rewrite your code to something like this: import Data.Maybe (fromMaybe) import System.IO (hFlush, stdout) import Text.Read (readMaybe) readDef :: a -> String -> a readDef def = fromMaybe def . readMaybe isAtLeast :: [a] -> Int -> Bool isAtLeast ls n | n <= 0 = True | null ls = False | otherwise = isAtLeast ls (n-1) execNTimes :: Int -> [a] -> IO () execNTimes n lst | n <= 0 = return() | do (from, to, quit) <- getCmds if quit then let z = slice from to xs m = foldl lcm 1 z in print $ m `mod` modVal else execNTimes (n-1) $ update from to lst execNTimes (n-1) lst where modVal :: Integer modVal = 1000000007 getCmds :: IO (Int, Int, Bool) getCmds = do putStr "Enter command: " hFlush stdout cmds <- words <$> getLine if not $ cmds `isAtLeast` 3 then do putStrLn "Too few commands" getCmds else let from = readDef 0 (cmds !! 1) :: Int to = readDef 0 (cmds !! 2) :: Int quit = head cmds == "Q" in if from < 0 || to >= length lst || from > to then do putStrLn "Invalid range" getCmds else (from, to, quit) Do note that the above code is untested, and that it's written on a mobile phone. I don't know what your intentions with the code are, so I added some error messages and variable names that you might want to change. About 'xs': xs is frequently used to mean "rest of list". I would recommend using ls or lst instead to name the whole list. -------------- next part -------------- An HTML attachment was scrubbed... URL: From yoyoyonny at gmail.com Mon May 9 15:07:03 2016 From: yoyoyonny at gmail.com (Jonne Ransijn) Date: Mon, 9 May 2016 17:07:03 +0200 Subject: [Haskell-cafe] Problems with function recursion in Haskell In-Reply-To: References: <57309104.3030407@gmail.com> Message-ID: Whoops, isAtLeast should be | otherwise = isAtLeast (tail ls) (n-1) -------------- next part -------------- An HTML attachment was scrubbed... URL: From johannes.waldmann at htwk-leipzig.de Mon May 9 15:50:35 2016 From: johannes.waldmann at htwk-leipzig.de (Johannes Waldmann) Date: Mon, 9 May 2016 17:50:35 +0200 Subject: [Haskell-cafe] Problems with function recursion in Haskell Message-ID: > ... homework ... it is highly unlikely that you will > find any help in the list or on stackoverflow. Quite often students do find homework "help" on stackoverflow. Of course SO will do nothing to discourage that. I'm not saying they should delete homework questions outright, but if they'd want quality, they'd introduce a "homework" tag so that these questions can be avoided more easily by people who would want to use SO to read/write quality answers/questions. But it seems that SO's goal is mostly numbers, that is, users. Actually, viewers for the job ads. And as long as the advertisers are paying ... Anyway, back to Haskell (but not leaving rant mode): the code example in the original question, although being rather short, manages to showcase several features that should be avoided in introductory teaching: numbers, lists, strings, and IO. (*) But, perhaps the instructor had a specific motivation. We can only guess, and that is why the recommended way for getting help with homework is (in that order): pay attention in class, then work on the exercises on your own, then with fellow students, and with the remaining questions, go to your instructor. - J.W. (*) and, recently, we should also avoid tuples https://mail.haskell.org/pipermail/libraries/2016-February/026678.html (I like the "matlab league" characterisation) From joe at myrtlesoftware.com Mon May 9 17:08:15 2016 From: joe at myrtlesoftware.com (Joe Hermaszewski) Date: Mon, 09 May 2016 18:08:15 +0100 Subject: [Haskell-cafe] Myrtle Software is looking for Haskell developers for exciting graphics/compilers/hardware work Message-ID: <1462813695.1180295.602555329.3F2C2E23@webmail.messagingengine.com> https://www.myrtlesoftware.com/vacancies/ We're a small software company in Cambridge, UK. We are working on some cool tech for lowering image processing algorithms to efficient hardware designs with a focus on putting these in autonomous vehicles. Our compiler is written completely in Haskell as well as some other tools we've written in house. We are looking to hire some more Haskell talent to help drive things forward. Please ask if you have any questions! From cdsmith at gmail.com Mon May 9 17:45:21 2016 From: cdsmith at gmail.com (Chris Smith) Date: Mon, 9 May 2016 10:45:21 -0700 Subject: [Haskell-cafe] Problems with function recursion in Haskell In-Reply-To: <57309104.3030407@gmail.com> References: <57309104.3030407@gmail.com> Message-ID: On Mon, May 9, 2016 at 6:30 AM, Henson wrote: > execNTimes 0 [] = return() > execNTimes n xs = if n<=0 || null xs > then return() > else do > si <- getLine > let s = words si > l = read (s !! 1) :: Int > r = read (s !! 2) :: Int > if head s=="Q" > then do > let z = slice l r xs > m = foldl lcm 1 z > print (m `mod` (toInteger 1000000007)) > else do > let s1 = update l r xs > execNTimes (n-1) s1 > execNTimes (n-1) xs > Your code is making the assumption that (words si) is non-empty. When that's not true, such as when the input from the console is empty, your program will crash at the use of `head`, since it throws an error when applied to an empty list. That's what you are seeing. Incidentally, by using `l` and `r` later on, you're also assuming that the input contains at least 2 more words after that first one. Violating that will also crash your program. Finally, your use of `read` means that the program will crash if the second two inputs are not numbers. All three of these functions should be used with great caution, or not at all, since they threaten to crash your program! Here's a very concise way to write this, using pattern guards: case words si of [ a, ls, rs ] , Right l <- readEither ls :: Either String Int , Right r <- readEither rs :: Either String Int -> if a == "Q" then do let x = slice l r xs let m = foldl lcm 1 z print (m `mod` (toInteger 1000000007)) else do let s1 = update l r xs execNTimes (n-1) s1 _ -> putStrLn "Invalid input." -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at schmong.org Mon May 9 23:59:40 2016 From: michael at schmong.org (Michael Litchard) Date: Mon, 9 May 2016 16:59:40 -0700 Subject: [Haskell-cafe] origin of my fibonacci test Message-ID: I have some code that checks to see if a number is a fibonacci number. It's not mine, I got it from somewhere and I need to credit it. I am pretty sure I got it from Stack Exchange but my search for it went nowhere. If this looks familiar to you, or you can tell me better ways to search, please let me know. isFib :: Integer -> Bool isFib n = n == a where (_, a, _) = unFib (1, 1) n unFib :: (Integer, Integer) -> Integer -> (Integer,Integer,Integer) unFib (a, b) n | n < a = (0, 0, 1) | n < e = (2*k, c, d) | otherwise = (2*k + 1, e, f) where (k, c, d) = unFib (fibPlus (a, b) (a, b)) n (e, f) = fibPlus (a, b) (c, d) fibPlus :: (Integer, Integer) -> (Integer, Integer) -> (Integer,Integer) fibPlus (a, b) (c, d) = (bd - (b - a)*(d - c), a*c + bd) where bd = b*d -------------- next part -------------- An HTML attachment was scrubbed... URL: From yoyoyonny at gmail.com Tue May 10 00:08:46 2016 From: yoyoyonny at gmail.com (Jonne Ransijn) Date: Tue, 10 May 2016 02:08:46 +0200 Subject: [Haskell-cafe] origin of my fibonacci test In-Reply-To: References: Message-ID: Hi Michael, I suppose this is where you got the code from? https://www.quora.com/What-is-the-most-efficient-algorithm-to-check-if-a-number-is-a-Fibonacci-Number It's the sixth result of the Google search "haskell: get if a number is a fibonacci number" On May 10, 2016 1:59 AM, "Michael Litchard" wrote: > I have some code that checks to see if a number is a fibonacci number. > It's not mine, I got it from somewhere and I need to credit it. I am pretty > sure I got it from Stack Exchange but my search for it went nowhere. If > this looks familiar to you, or you can tell me better ways to search, > please let me know. > > isFib :: Integer -> Bool > isFib n = n == a where (_, a, _) = unFib (1, 1) n > > unFib :: (Integer, Integer) -> Integer -> (Integer,Integer,Integer) > unFib (a, b) n > | n < a = (0, 0, 1) > | n < e = (2*k, c, d) > | otherwise = (2*k + 1, e, f) > where > (k, c, d) = unFib (fibPlus (a, b) (a, b)) n > (e, f) = fibPlus (a, b) (c, d) > > fibPlus :: (Integer, Integer) -> (Integer, Integer) -> (Integer,Integer) > fibPlus (a, b) (c, d) = (bd - (b - a)*(d - c), a*c + bd) > where bd = b*d > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fa-ml at ariis.it Tue May 10 00:08:31 2016 From: fa-ml at ariis.it (Francesco Ariis) Date: Tue, 10 May 2016 02:08:31 +0200 Subject: [Haskell-cafe] origin of my fibonacci test In-Reply-To: References: Message-ID: <20160510000831.GA9500@casa.casa> On Mon, May 09, 2016 at 04:59:40PM -0700, Michael Litchard wrote: > I have some code that checks to see if a number is a fibonacci number. It's > not mine, I got it from somewhere and I need to credit it. I am pretty sure > I got it from Stack Exchange but my search for it went nowhere. If this > looks familiar to you, or you can tell me better ways to search, please let > me know. > > [...] This [1] leads to this [2] (whether it's original or was snatched from somewhere else, I don't know!) [1] https://duckduckgo.com/?q=isfib+unfib+fibplus&t=ffnt [2] https://www.quora.com/What-is-the-most-efficient-algorithm-to-check-if-a-number-is-a-Fibonacci-Number From michael at schmong.org Tue May 10 00:13:42 2016 From: michael at schmong.org (Michael Litchard) Date: Mon, 9 May 2016 17:13:42 -0700 Subject: [Haskell-cafe] origin of my fibonacci test In-Reply-To: References: Message-ID: That's it thanks. On Mon, May 9, 2016 at 5:08 PM, Jonne Ransijn wrote: > Hi Michael, > > I suppose this is where you got the code from? > > https://www.quora.com/What-is-the-most-efficient-algorithm-to-check-if-a-number-is-a-Fibonacci-Number > > It's the sixth result of the Google search "haskell: get if a number is a > fibonacci number" > On May 10, 2016 1:59 AM, "Michael Litchard" wrote: > >> I have some code that checks to see if a number is a fibonacci number. >> It's not mine, I got it from somewhere and I need to credit it. I am pretty >> sure I got it from Stack Exchange but my search for it went nowhere. If >> this looks familiar to you, or you can tell me better ways to search, >> please let me know. >> >> isFib :: Integer -> Bool >> isFib n = n == a where (_, a, _) = unFib (1, 1) n >> >> unFib :: (Integer, Integer) -> Integer -> (Integer,Integer,Integer) >> unFib (a, b) n >> | n < a = (0, 0, 1) >> | n < e = (2*k, c, d) >> | otherwise = (2*k + 1, e, f) >> where >> (k, c, d) = unFib (fibPlus (a, b) (a, b)) n >> (e, f) = fibPlus (a, b) (c, d) >> >> fibPlus :: (Integer, Integer) -> (Integer, Integer) -> (Integer,Integer) >> fibPlus (a, b) (c, d) = (bd - (b - a)*(d - c), a*c + bd) >> where bd = b*d >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From ekmett at gmail.com Tue May 10 02:31:17 2016 From: ekmett at gmail.com (Edward Kmett) Date: Mon, 9 May 2016 22:31:17 -0400 Subject: [Haskell-cafe] Summer of Haskell Mentors Message-ID: If you are interesting in helping out as a possible mentor for this year's Summer of Haskell, please email me, and include MENTOR in the title. Thank you! -Edward From voldermort at hotmail.com Thu May 5 07:50:26 2016 From: voldermort at hotmail.com (Jeremy) Date: Thu, 5 May 2016 00:50:26 -0700 (MST) Subject: [Haskell-cafe] Haskell Weekly News In-Reply-To: References: Message-ID: <1462434626056-5835273.post@n5.nabble.com> Kim-Ee Yeoh wrote > p.s. There will be no News next week. HWN will resume the week after. It's been a long week! -- View this message in context: http://haskell.1045720.n5.nabble.com/Haskell-Weekly-News-tp5828692p5835273.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com. From michael at schmong.org Tue May 10 16:39:20 2016 From: michael at schmong.org (Michael Litchard) Date: Tue, 10 May 2016 09:39:20 -0700 Subject: [Haskell-cafe] Using parallels for fibonacci Message-ID: I am trying to efficiently use multicores for my fizzbuzz project. My fizzbuzz uses a Fibonacci generator as input, and this is where it can get computationally heavy. I believe I have picked the best algorithm for my project (please correct this if wrong), and now I am trying to use the parallel package . I am not getting any better performance in the sense that if I try to compute the 100th Fibonacci number, it is still computing , using 4 cores, several minutes later. Here is my attempt. Please show me how to use this library right. from src/FizzBuzz.hs fizzBuzzFib :: Integer -> [Text] fizzBuzzFib ub = parMap rdeepseq fizzbuzz $! fibSeq ub from src/FizzFub.hs fibSeq :: Integer -> [Integer] fibSeq ub = withStrategy (parBuffer buffer rdeepseq) $ genericTake ub fibbwhere buffer = 100 fibb :: [Integer] fibb = 0 : 1 : zipWith (+) fibb (tail fibb) -------------- next part -------------- An HTML attachment was scrubbed... URL: From miguel.a.santos.l at gmail.com Tue May 10 20:01:22 2016 From: miguel.a.santos.l at gmail.com (Miguel A. Santos) Date: Tue, 10 May 2016 16:01:22 -0400 Subject: [Haskell-cafe] Automatic differentiation (AD) with respect to list of matrices in Haskell In-Reply-To: References: <878tzkwjym.fsf@purelyfunctional.org> <877ff4wgng.fsf@purelyfunctional.org> Message-ID: Sorry, while that all did work before, it looks like I screwed up again. Tried playing around varying things trying to understand your fix better, but I seem not to be able to figured out how to fix it now. This type issues feel bizarre! The code below doesn't compile. The error is now on a line that before gave absolutely no problem before, name the evaluation of sc1 xin mbW1. The error is now, basically, "expected [Scalar a] ; Actual [Double a]" and explicitly stating types doesn't help either. That is, explicitly declaring sc1 type as "sc1 :: (Floating a, Mode a) => [Scalar a] -> Matrix a -> a" still gives that error. Yet, there is no problem in calculating its gradient, namely "grad (sc1 xin) mbW1" works ok !? I'm at lost here. What's wrong/missing now? Evaluation of sc0 or sc2 on the input list xin works, but no for sc1!? Somehow, from the detailed error message (see below) it looks like ghc can't really figure out the type of 'a' in '[Scalar a]'. Some lack of injectivity issues or so? And I can only imaging that the type Double it sees may be induced by the use of the exponential implicit in the definition of `phi'` which is used in that of sc1, but I have no clue how to tweak `phi'`. As I said before, I still don't grasp Haskell's type system. Usually it seems easier to not give explicitly a type and let ghc guess it. Unfortunately this doesn't work in the present case. I apologize in advance if I happen to be missing something elementary. I just don't see it. Regards, MA PD: Without the offending line evaluating sc1, the output of the program is (again the 1,2,3 is my arbitrary input to the program): -------- mbW1:M [[1,0,0],[-1,5,1],[1,2,-3]] mbW2:M [[0,0,0],[1,3,-1],[-2,4,6]] --- sc0: --- sc0 xin mbW1 1 2 3 9.0 grad (sc0 [3,5,7]) mbW1 M [[3,5,7],[3,5,7],[3,5,7]] --- sc1: --- grad (sc1 xin) mbW1 M [[1.0,2.0,3.0],[6.1441368513331755e-6,1.2288273702666351e-5,1.8432410553999525e-5],[1.7662706213291118e-2,3.5325412426582235e-2,5.298811863987335e-2]] grad (sc1 [3,5,7]) mbW1 M [[3.0,5.0,7.0],[7.630996942126885e-13,1.2718328236878141e-12,1.7805659531629398e-12],[1.0057130122694228e-3,1.6761883537823711e-3,2.3466636952953197e-3]] --- sc2: --- sc2 xin [mbW1,mbW2] 1.8733609463863194 --- sc3: --- grad (sc3 xin) [mbW1,mbW2] MatrixList [M [[-0.1752205960584877,-0.3504411921169754,-0.525661788175463],[2.7052661672554392e-6,5.4105323345108785e-6,8.115798501766318e-6],[9.919472739879849e-3,1.9838945479759697e-2,2.9758418219639544e-2]],M [[1.0,0.9999938558253978,1.798620996209156e-2],[1.79718498433056e-2,1.7971739421122238e-2,3.232454646888768e-4],[9.659622295089665e-2,9.659562944683693e-2,1.7373999475398345e-3]]] -------- and the code producing that output is: -------- {-# LANGUAGE DeriveTraversable, DeriveFunctor, DeriveFoldable #-} import Numeric.AD import Numeric.AD.Mode.Reverse as R import Data.Traversable as T import Data.Foldable as F --- Non-linear function on "vectors" logistic x = 1.0 / (1.0 + exp(-x) ) phi v = map logistic v phi' (x:xs) = x : (phi xs) --- dot product dot u v = foldr (+) 0 $ zipWith (*) u v --- simple matrix type data Matrix a = M [[a]] deriving (Eq,Show,Functor,F.Foldable,T.Traversable) --- action of a matrix on a vector mv _ [] = [] mv (M []) _ = [] mv ( M m ) v = ( dot (head m) v ) : (mv (M (tail m)) v ) --- two matrices mbW1,mbW2 :: Num a => Matrix a mbW1 = M $ [[1,0,0],[-1,5,1],[1,2,-3]] mbW2 = M $ [[0,0,0],[1,3,-1],[-2,4,6]] --- different scoring functions sc0 v m = foldr (+) 0 $ mv m v --sc1 :: (Floating a, Mode a) => [Scalar a] -> Matrix a -> a sc1 v m = foldr (+) 0 $ (phi' . (mv m) ) (map auto v) --sc2 :: Floating a => [a] -> [Matrix a] -> a sc2 v [m1, m2] = foldr (+) 0 $ (phi' . (mv m2) . phi' . (mv m1) ) v -- Provide a type signature, use auto and use the newtype newtype MatrixList a = MatrixList [Matrix a] deriving (Show, Functor,Foldable,Traversable) sc3 :: (Floating a, Mode a) => [Scalar a] -> MatrixList a -> a sc3 v (MatrixList [m1, m2]) = foldr (+) 0 $ (phi' . (mv m2) . phi' . (mv m1) ) (map auto v) strToInt = read :: String -> Double strLToIntL = map strToInt --- testing main = do putStrLn $ "mbW1:" ++ (show mbW1) putStrLn $ "mbW2:" ++ (show mbW2) rawInput <- readFile "/dev/stdin" let xin= strLToIntL $ lines rawInput --- putStrLn "---\nsc0:\n---" --- --putStrLn "sc0 [3,5,7] mbW1" --print $ sc0 [3,5,7] mbW1 putStrLn "sc0 xin mbW1" print $ sc0 xin mbW1 putStrLn "grad (sc0 [3,5,7]) mbW1" print $ grad ( sc0 [3,5,7]) mbW1 --print $ grad ( sc0 xin) mbW1 --- putStrLn "---\nsc1:\n---" --- --putStrLn "sc1 xin mbW1" --print $ sc1 xin mbW1 --- ok. = NOT OK anymore using map auto!? : Expected [Scalar a0] ; Actual [Double] putStrLn "grad (sc1 xin) mbW1" print $ grad ( sc1 xin) mbW1 -- ok now just with auto !? Was: yields an error: expects xin [Reverse s Double] instead of [Double] putStrLn "grad (sc1 [3,5,7]) mbW1" print $ grad ( sc1 [3,5,7]) mbW1 --- ok. = --- putStrLn "---\nsc2:\n---" --- putStrLn "sc2 xin [mbW1,mbW2]" print $ sc2 xin [mbW1, mbW2] --- putStrLn "---\nsc3:\n---" --- putStrLn "grad (sc3 xin) [mbW1,mbW2]" print $ grad ( sc3 xin) (MatrixList [mbW1, mbW2]) -------- When trying to evaluate 'sc1 xin mbW1', the he precise error message is: -------- Couldn't match type ?Scalar r0? with ?Double? The type variable ?r0? is ambiguous Expected type: [Scalar r0] Actual type: [Double] In the first argument of ?sc1?, namely ?xin? In the second argument of ?($)?, namely ?sc1 xin mbW1? -- Public key ID: E8FE60D7 Public key server: see, e.g., hkp://keys.gnupg.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From tekul.hs at gmail.com Tue May 10 21:49:40 2016 From: tekul.hs at gmail.com (Luke Taylor) Date: Tue, 10 May 2016 22:49:40 +0100 Subject: [Haskell-cafe] OAuth2 and OpenID Connect in Haskell Message-ID: Hello all, I've written a blog article as an introduction to the Haskell project I've been working on, which may be of interest to some people here. It's an OpenID Connect identity provider. http://broch.io/posts/oauth2-openid-connect-haskell/ I'd really welcome any feedback on other/better ways of doing some of things it talks about. Cheers, Luke. From ky3 at atamo.com Wed May 11 01:32:31 2016 From: ky3 at atamo.com (Kim-Ee Yeoh) Date: Wed, 11 May 2016 08:32:31 +0700 Subject: [Haskell-cafe] Haskell Weekly News In-Reply-To: <1462434626056-5835273.post@n5.nabble.com> References: <1462434626056-5835273.post@n5.nabble.com> Message-ID: Hi Jeremy, >> p.s. There will be no News next week. HWN will resume the week after. > It's been a long week! Yes, and that hiatus makes me testy as well. Here are some sources of Haskell news: http://haskellnews.org https://lobste.rs/t/haskell https://www.reddit.com/r/haskell/top/?sort=top&t=week I've been working at longer form articles in HWN for some time now. What's happening is that I end up spending gobs of time coaching writers to deliver on articles that make an impact on the community. Meanwhile, I'll adopt a "Just The Links, Please" format kin to what you see here: http://us1.campaign-archive2.com/?u=faa8eb4ef3a111cef92c4f3d4&id=39a8877ff4 Thanks for the nudge. Best, Kim-Ee On Thursday, May 5, 2016, Jeremy > wrote: > Kim-Ee Yeoh wrote > > p.s. There will be no News next week. HWN will resume the week after. > > It's been a long week! > > > > -- > View this message in context: > http://haskell.1045720.n5.nabble.com/Haskell-Weekly-News-tp5828692p5835273.html > Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com. > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > -- -- Kim-Ee -------------- next part -------------- An HTML attachment was scrubbed... URL: From dominikbollmann at gmail.com Wed May 11 10:49:54 2016 From: dominikbollmann at gmail.com (Dominik Bollmann) Date: Wed, 11 May 2016 12:49:54 +0200 Subject: [Haskell-cafe] Template Haskell Tutorial Message-ID: <87inykhnsd.fsf@t450s.i-did-not-set--mail-host-address--so-tickle-me> Hi, I've been diving into Template Haskell recently and thought to write down what I've learned. The result hopes to be a practical, example-driven introduction to Template Haskell's main features: https://wiki.haskell.org/A_practical_Template_Haskell_Tutorial I hope it serves others new to Template Haskell. It's all on the Haskell wiki, so feedback and improvements are welcome! Cheers, Dominik. From ivan.miljenovic at gmail.com Wed May 11 13:02:12 2016 From: ivan.miljenovic at gmail.com (Ivan Lazar Miljenovic) Date: Wed, 11 May 2016 23:02:12 +1000 Subject: [Haskell-cafe] Applying a Constraint to a Proxy'd type In-Reply-To: References: Message-ID: Hi Adam, On 9 May 2016 at 07:15, adam vogt wrote: > Hi Ivan, > > When I compile your file with -fprint-explicit-kinds (which is very helpful > to make sense of code using -XPolyKinds), the type error includes an > inferred type like > >> (LiftConstraint * * EqNum (Proxy k n)) > > but if you look at the kind of LiftConstraint: > >> LiftConstraint :: (k1 -> Constraint) -> k2 -> Constraint > > You need the k1 to be equal to the k that's inside the Proxy, but ghc > decides that the k1 and k2 are * early on, and then cannot change that > decision after choosing an equation for LiftConstraint_. > > One solution is to restrict the kind of what's inside the Proxy, say by > adding (n :: *) in the type signature for fn. I forgot to mention in my simplified example that I was already doing that. > I think a general rule for poly-kinded proxies is that you should "pattern > match" on them in the class method signature and not in the instance heads > (or the equivalent using other language features). In your case it would > involve changing LiftConstraint etc. so that you could write: > >> fn :: LiftConstraint Num n => Proxy n -> Bool > > But then LiftConstraint_ can't have it's second equation. The problem for me is that this makes my more general "take an arbitrary `a' that satisfies the constraint" approach. I'm beginning to think that this isn't possible; specifically because there's no way for GHC to infer that _only_ values of the form (Proxy a) can satisfy the constraint as I can't put the Proxy usage into the typeclass. So it looks like I have to try and generalise my function even more. > I think your problem comes up with a smaller type function: > >> type family UnProxy x :: k where UnProxy (Proxy x) = x > > You could say that 'k' could be determined by what is inside Proxy. But ghc > depends on the caller of UnProxy to decide what the 'k' is and complains > when it guessed wrong instead. The type constructor Proxy is more like > Dynamic than Maybe: `(fromDynamic . toDyn) :: (Typeable a, Typeable b) => a > -> Maybe b` probably ought to have type `Typeable a => a -> Maybe a`, but it > doesn't in the same way that this fails without an additional kind > signature: > >> type BadId x = UnProxy (Proxy x) >> type SillyId (x :: k) = UnProxy (Proxy x) :: k > > Hope this helps. Well, it helps me work out that my approach is almost definitely wrong, but I suppose that's better than continually bashing my head at it :p > > Regards, > Adam > > On Sun, May 8, 2016 at 8:15 AM, Ivan Lazar Miljenovic > wrote: >> >> I'm not sure if it's possible (and I have an alternate method of doing >> this so it isn't strictly speaking _necessary_, but would make the >> code cleaner if I can), but I would like to convert a "value" of kind >> (k -> Constraint) into one of kind (Proxy k -> Constraint). >> >> I can achieve this using a type family (note: I've also made this >> polymorphic in terms of the Proxy type used, but that isn't >> necessary): >> >> > type family LiftConstraint_ c pa :: Constraint where >> > LiftConstraint_ c (proxy a) = c a >> > LiftConstraint_ c pa = () ~ Bool -- A nonsensical failing >> > Constraint value >> >> which has the problem that it can't be partially applied (which I also >> need). This can be wrapped up in a typeclass: >> >> > class (LiftConstraint_ c pa) => LiftConstraint c pa >> > instance (LiftConstraint_ c pa) => LiftConstraint c pa >> >> The problem with this is that if I try and use it somewhere that - >> having already a type of kind (c :: * -> Constraint) from the >> environment - that expects a function of type (forall a. (c a) => a -> >> b) with a fixed "b" value, then trying to use something like this >> function prevents it from working (for the purposes of argument, >> assume the old specification of Num that had an Eq superclass; this is >> the way I can produce the smallest example): >> >> > fn :: forall pn. (LiftConstraint Num (Proxy n)) => Proxy n -> Bool >> > fn = join (==) . asProxyTypeOf 0 >> >> The resulting error message is: "Could not deduce (a ~ Proxy n0) ..." >> >> This occurs even if I make the type of fn polymorphic in terms of the >> proxy type or if I make LiftConstraint_ specific. Note that the error >> goes away if I make the definition to be "fn = const True"; it's only >> if I try and _use_ the proxy value. >> >> I've tried defining and using an IsProxy type family + class but that >> fails to the same basic problem: it can't tell that the provided value >> can be pulled apart to get what's in the Proxy. >> >> Any ideas? >> >> -- >> Ivan Lazar Miljenovic >> Ivan.Miljenovic at gmail.com >> http://IvanMiljenovic.wordpress.com >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > -- Ivan Lazar Miljenovic Ivan.Miljenovic at gmail.com http://IvanMiljenovic.wordpress.com From mlang at delysid.org Wed May 11 15:34:51 2016 From: mlang at delysid.org (Mario Lang) Date: Wed, 11 May 2016 17:34:51 +0200 Subject: [Haskell-cafe] Using parallels for fibonacci In-Reply-To: (Michael Litchard's message of "Tue, 10 May 2016 09:39:20 -0700") References: Message-ID: <87vb2kk3qc.fsf@fx.delysid.org> Michael Litchard writes: > I am trying to efficiently use multicores for my fizzbuzz > project. My fizzbuzz uses a > Fibonacci generator as input, and this is where it can get computationally > heavy. I believe I have picked the best algorithm for my project (please > correct this if wrong), I'd like to point you to this rather interesting task and code example I happened to stumble across recently: https://www.youtube.com/watch?v=32f6JrQPV8c (18:30-21:40) https://github.com/sean-parent/scratch/blob/master/scratch/main.cpp Sean is basically saying that doing fibonacci via recursion is wrong. Fibonacci is actually a linear recurrance, and can be calculated with a power algorithm. The Haskell Wiki has a section about this approach: https://wiki.haskell.org/The_Fibonacci_sequence#Using_2x2_matrices The code below gives fib of 100000000 in a few seconds on my PC. No need to go paralell. And if you need the complete series, [fib n | n <- [1..1000000]] still just takes a second here. ```Haskell module PowerFib where import Data.List (transpose) newtype Matrix a = Matrix [[a]] deriving (Eq, Show) instance Num a => Num (Matrix a) where Matrix as + Matrix bs = Matrix (zipWith (zipWith (+)) as bs) Matrix as - Matrix bs = Matrix (zipWith (zipWith (-)) as bs) Matrix as * Matrix bs = Matrix [[sum $ zipWith (*) a b | b <- transpose bs] | a <- as] negate (Matrix as) = Matrix (map (map negate) as) fromInteger x = Matrix (iterate (0:) (fromInteger x : repeat 0)) abs m = m signum _ = 1 apply (Matrix as) b = [sum (zipWith (*) a b) | a <- as] fib n = head (apply (Matrix [[0,1], [1,1]] ^ n) [0,1]) ``` -- CYa, ????? From jgbailey at gmail.com Wed May 11 15:41:15 2016 From: jgbailey at gmail.com (Justin Bailey) Date: Wed, 11 May 2016 08:41:15 -0700 Subject: [Haskell-cafe] Template Haskell Tutorial In-Reply-To: <87inykhnsd.fsf@t450s.i-did-not-set--mail-host-address--so-tickle-me> References: <87inykhnsd.fsf@t450s.i-did-not-set--mail-host-address--so-tickle-me> Message-ID: The section describing the TH data types, followed by yoru explanation of splicing and quoting is written really well. I think you need to call them out in a separate section. If I didn't know TH, I would find that section really illuminating. Didn't have time to read the rest but nice start! On Wed, May 11, 2016 at 3:49 AM, Dominik Bollmann wrote: > > Hi, > > I've been diving into Template Haskell recently and thought to write > down what I've learned. The result hopes to be a practical, > example-driven introduction to Template Haskell's main features: > > https://wiki.haskell.org/A_practical_Template_Haskell_Tutorial > > I hope it serves others new to Template Haskell. It's all on the Haskell > wiki, so feedback and improvements are welcome! > > Cheers, Dominik. > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe From michael at schmong.org Wed May 11 15:49:34 2016 From: michael at schmong.org (Michael Litchard) Date: Wed, 11 May 2016 08:49:34 -0700 Subject: [Haskell-cafe] Using parallels for fibonacci In-Reply-To: <87vb2kk3qc.fsf@fx.delysid.org> References: <87vb2kk3qc.fsf@fx.delysid.org> Message-ID: Thank you Mario, that was interesting in and of itself. On Wed, May 11, 2016 at 8:34 AM, Mario Lang wrote: > Michael Litchard writes: > > > I am trying to efficiently use multicores for my fizzbuzz > > project. My fizzbuzz uses a > > Fibonacci generator as input, and this is where it can get > computationally > > heavy. I believe I have picked the best algorithm for my project (please > > correct this if wrong), > > I'd like to point you to this rather interesting task and code example I > happened to stumble across recently: > > https://www.youtube.com/watch?v=32f6JrQPV8c (18:30-21:40) > https://github.com/sean-parent/scratch/blob/master/scratch/main.cpp > > Sean is basically saying that doing fibonacci via recursion is wrong. > Fibonacci is actually a linear recurrance, and can be calculated with a > power algorithm. > > The Haskell Wiki has a section about this approach: > https://wiki.haskell.org/The_Fibonacci_sequence#Using_2x2_matrices > > The code below gives fib of 100000000 in a few seconds on my PC. > No need to go paralell. > > And if you need the complete series, [fib n | n <- [1..1000000]] still > just takes a second here. > > ```Haskell > module PowerFib where > import Data.List (transpose) > > newtype Matrix a = Matrix [[a]] deriving (Eq, Show) > instance Num a => Num (Matrix a) where > Matrix as + Matrix bs = Matrix (zipWith (zipWith (+)) as bs) > Matrix as - Matrix bs = Matrix (zipWith (zipWith (-)) as bs) > Matrix as * Matrix bs = Matrix [[sum $ zipWith (*) a b | b <- transpose > bs] | a <- as] > negate (Matrix as) = Matrix (map (map negate) as) > fromInteger x = Matrix (iterate (0:) (fromInteger x : repeat 0)) > abs m = m > signum _ = 1 > > apply (Matrix as) b = [sum (zipWith (*) a b) | a <- as] > > fib n = head (apply (Matrix [[0,1], [1,1]] ^ n) [0,1]) > ``` > > -- > CYa, > ????? > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfsihenson at gmail.com Fri May 13 18:47:29 2016 From: jfsihenson at gmail.com (Henson) Date: Fri, 13 May 2016 15:47:29 -0300 Subject: [Haskell-cafe] Haskell Better Editor In-Reply-To: <57309104.3030407@gmail.com> References: <57309104.3030407@gmail.com> Message-ID: <57362141.7070205@gmail.com> Friends, What's the better text editor for Haskell development? More productive and more rapid learning curve? Any trick for initiating in haskell and rapid advance? Please let your comments. Thank you, Josenildo From wojciech.danilo at gmail.com Fri May 13 19:26:12 2016 From: wojciech.danilo at gmail.com (Wojciech Danilo) Date: Fri, 13 May 2016 19:26:12 +0000 Subject: [Haskell-cafe] Haskell Better Editor In-Reply-To: <57362141.7070205@gmail.com> References: <57309104.3030407@gmail.com> <57362141.7070205@gmail.com> Message-ID: Try atom. The only editors with better support are vim and emacs. On Fri, 13 May 2016 at 20:47, Henson wrote: > Friends, > > What's the better text editor for Haskell development? > More productive and more rapid learning curve? > Any trick for initiating in haskell and rapid advance? > Please let your comments. > > Thank you, > Josenildo > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From joseph.d.melfi at gmail.com Fri May 13 19:28:51 2016 From: joseph.d.melfi at gmail.com (Joseph Melfi) Date: Fri, 13 May 2016 12:28:51 -0700 Subject: [Haskell-cafe] Haskell Better Editor In-Reply-To: References: Message-ID: <57362aba0df02a00009aae20@polymail.io> I?d go with Atom. ?Good support for syntax and stack or cabal environment setups. Joseph Melfi On Fri, May 13, 2016 at 12:26 PM Wojciech Danilo < mailto:Wojciech Danilo > wrote: Try atom. The only editors with better support are vim and emacs. On Fri, 13 May 2016 at 20:47, Henson < mailto:jfsihenson at gmail.com > wrote: Friends, What's the better text editor for Haskell development? More productive and more rapid learning curve? Any trick for initiating in haskell and rapid advance? Please let your comments. Thank you, Josenildo _______________________________________________ Haskell-Cafe mailing list mailto:Haskell-Cafe at haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe _______________________________________________ Haskell-Cafe mailing list mailto:Haskell-Cafe at haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.feuer at gmail.com Fri May 13 19:55:29 2016 From: david.feuer at gmail.com (David Feuer) Date: Fri, 13 May 2016 15:55:29 -0400 Subject: [Haskell-cafe] Haskell Better Editor In-Reply-To: <57362141.7070205@gmail.com> References: <57309104.3030407@gmail.com> <57362141.7070205@gmail.com> Message-ID: Much as I hate emacs, I have to admit it is a pretty awesome Haskell development environment once you get it set up right. On May 13, 2016 2:47 PM, "Henson" wrote: > Friends, > > What's the better text editor for Haskell development? > More productive and more rapid learning curve? > Any trick for initiating in haskell and rapid advance? > Please let your comments. > > Thank you, > Josenildo > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexander.kjeldaas at gmail.com Fri May 13 19:59:45 2016 From: alexander.kjeldaas at gmail.com (Alexander Kjeldaas) Date: Fri, 13 May 2016 21:59:45 +0200 Subject: [Haskell-cafe] Haskell Better Editor In-Reply-To: References: <57309104.3030407@gmail.com> <57362141.7070205@gmail.com> Message-ID: For the emacs route, do try spacemacs as the default emacs setup has no batteries included, and a rather large manual needed for assembly. On Fri, May 13, 2016 at 9:55 PM, David Feuer wrote: > Much as I hate emacs, I have to admit it is a pretty awesome Haskell > development environment once you get it set up right. > On May 13, 2016 2:47 PM, "Henson" wrote: > >> Friends, >> >> What's the better text editor for Haskell development? >> More productive and more rapid learning curve? >> Any trick for initiating in haskell and rapid advance? >> Please let your comments. >> >> Thank you, >> Josenildo >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >> > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin.jan.mrotek at gmail.com Fri May 13 21:47:33 2016 From: marcin.jan.mrotek at gmail.com (Marcin Mrotek) Date: Fri, 13 May 2016 23:47:33 +0200 Subject: [Haskell-cafe] Haskell Better Editor In-Reply-To: References: <57309104.3030407@gmail.com> <57362141.7070205@gmail.com> Message-ID: Hello, >I'm using ViM with that started material: >http://www.stephendiehl.com/posts/vim_2016.html >If exist any better that inform please. Eh, sorry, I think I've responded only to you instead of the whole group. Anyway, I'm using Atom, and while I don't actually "like" this editor (in fact, I find it very annoying, with slow loading times on a 4 core processor, and occasional white screen of death on Windows) I still think it's the best of the ones I've tried (vim, emacs + evil mode, leksah). Best regards, Marcin Mrotek -------------- next part -------------- An HTML attachment was scrubbed... URL: From targen at gmail.com Fri May 13 22:52:46 2016 From: targen at gmail.com (=?UTF-8?Q?Manuel_G=C3=B3mez?=) Date: Fri, 13 May 2016 18:52:46 -0400 Subject: [Haskell-cafe] Haskell Better Editor In-Reply-To: References: <57309104.3030407@gmail.com> <57362141.7070205@gmail.com> Message-ID: On Fri, May 13, 2016 at 5:47 PM, Marcin Mrotek wrote: > Hello, > >>I'm using ViM with that started material: >>http://www.stephendiehl.com/posts/vim_2016.html >>If exist any better that inform please. > > Eh, sorry, I think I've responded only to you instead of the whole group. > Anyway, I'm using Atom, and while I don't actually "like" this editor (in > fact, I find it very annoying, with slow loading times on a 4 core > processor, and occasional white screen of death on Windows) I still think > it's the best of the ones I've tried (vim, emacs + evil mode, leksah). Not sure who asked about Vim, but there?s https://github.com/begriffs/haskell-vim-now From julian at getcontented.com.au Sat May 14 12:57:48 2016 From: julian at getcontented.com.au (Julian Leviston) Date: Sat, 14 May 2016 22:57:48 +1000 Subject: [Haskell-cafe] Haskell-Cafe Digest, Vol 153, Issue 17 In-Reply-To: References: Message-ID: If you?re on the mac, Haskell for Mac is very good to start with. http://haskellformac.com http://www.happylearnjavascripttutorial.com/ - begin programming with JavaScript today using our awesome new method! http://www.happylearnhaskelltutorial.com/ - begin programming with Haskell today using our awesome new method! > On 14 May 2016, at 10:00 PM, haskell-cafe-request at haskell.org wrote: > > Date: Fri, 13 May 2016 15:47:29 -0300 > From: Henson > > To: haskell-cafe at haskell.org > Subject: [Haskell-cafe] Haskell Better Editor > Message-ID: <57362141.7070205 at gmail.com > > Content-Type: text/plain; charset=windows-1252; format=flowed > > Friends, > > What's the better text editor for Haskell development? > More productive and more rapid learning curve? > Any trick for initiating in haskell and rapid advance? > Please let your comments. > > Thank you, > Josenildo -------------- next part -------------- An HTML attachment was scrubbed... URL: From fr33domlover at riseup.net Sat May 14 20:57:30 2016 From: fr33domlover at riseup.net (fr33domlover) Date: Sat, 14 May 2016 23:57:30 +0300 Subject: [Haskell-cafe] Yesos forms and types with foreign keys Message-ID: Hello, I have a question about RESTful web apps in Haskell. I'm using Yesod but I suppose the same question can apply to any other framework with type safety features. Suppose I have entities A and B defined in my Persistent model file. One of A's fields is a foreign key referring to B. Each A has its own unique B. The process of creating a new A would be: 1. Set the user a web form via GET 2. Receive for field data via POST 3. Validate the input 4. Insert a new B value to the DB, and get its ID 5. Define an A value which includes that ID as a foreign key, and insert the new A value to the DB In Yesod, If I use a form of type 'AForm A', running the form must return a complete A value. But when I runFormPost, I don't have the B entity yet so I don't have an ID for the foreign key! Ideas what I can do: - Set that field to some dummy value, and override it later when I insert the B value and get its ID - Define a 'NewA' type which has the same fields as A except for that foreign key field - Insert to the DB in the form itself. Define my form as an MForm so that I have access to Handler monad and use runDB to insert to the DB right in the form itself, i.e. form success means the DB has been updated I know little about REST common practice but afaik to allow alternative representations, e.g. a JSON API, my forms need to return entity types, e.g. A and not some partial NewA. Also my forms so far are all simple AForms which just do validation, sometimes against the DB, and never insert or delete anything. Insertion and deletetion I always do in the handlers. The dummy value may work, I already have one case where I use it, but it's ugly and requires that I rely on the specific underlying type of the key, e.g. Int64 for postgresql but could be ByteString for other backends if I ever want to change. Maybe some 'dummyKey' function could make it prettier, if at all this is a good approach. What should I do here? --fr33 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 801 bytes Desc: not available URL: From dsf at seereason.com Sat May 14 21:32:44 2016 From: dsf at seereason.com (David Fox) Date: Sat, 14 May 2016 14:32:44 -0700 Subject: [Haskell-cafe] [ANN] process-extras-0.4.1 Message-ID: I thought I should announce the process-extras package, available from hackage . It extends the process reading functions in System.Process to allow output types ByteString and Text, both strict and lazy. It also provides a function readCreateProcessLazy that can read from processes whose output is infinite - the regular readProcess functions block until they find EOF. There are also some new usage examples in the README.md file. This package has a long history, so if you are familiar with an older version you may want to take another look. Best, David Fox -------------- next part -------------- An HTML attachment was scrubbed... URL: From ch.howard at zoho.com Sun May 15 05:23:23 2016 From: ch.howard at zoho.com (Christopher Howard) Date: Sat, 14 May 2016 21:23:23 -0800 Subject: [Haskell-cafe] Confirmation Email for Hackage Account? Message-ID: <573807CB.1000002@zoho.com> Hi. How long does it usually take to receive the confirmation email for a hackage account registration? -- http://justonemoremathproblem.com To protect my privacy, please use PGP encryption. It's free and easy to use! My public key ID is 0x340EA95A (pgp.mit.edu). From gershomb at gmail.com Sun May 15 05:38:12 2016 From: gershomb at gmail.com (Gershom B) Date: Sun, 15 May 2016 01:38:12 -0400 Subject: [Haskell-cafe] Confirmation Email for Hackage Account? In-Reply-To: <573807CB.1000002@zoho.com> References: <573807CB.1000002@zoho.com> Message-ID: Should be within a matter of minutes. If not, there?s likely something wrong.? ?gershom On May 15, 2016 at 1:23:36 AM, Christopher Howard (ch.howard at zoho.com) wrote: > Hi. How long does it usually take to receive the confirmation email for > a hackage account registration? > > -- > http://justonemoremathproblem.com > To protect my privacy, please use PGP encryption. It's free and easy > to use! My public key ID is 0x340EA95A (pgp.mit.edu). > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > From ch.howard at zoho.com Sun May 15 06:03:10 2016 From: ch.howard at zoho.com (Christopher Howard) Date: Sat, 14 May 2016 22:03:10 -0800 Subject: [Haskell-cafe] Confirmation Email for Hackage Account? In-Reply-To: <573807CB.1000002@zoho.com> References: <573807CB.1000002@zoho.com> Message-ID: <5738111E.9000302@zoho.com> Hi, I still haven't received the confirmation email, and I can't find it in my spam folders. Is there a Hackage admin on the list who can help me out? On 05/14/2016 09:23 PM, Christopher Howard wrote: > Hi. How long does it usually take to receive the confirmation email for > a hackage account registration? > -- http://justonemoremathproblem.com To protect my privacy, please use PGP encryption. It's free and easy to use! My public key ID is 0x340EA95A (pgp.mit.edu). From ch.howard at zoho.com Sun May 15 06:07:22 2016 From: ch.howard at zoho.com (Christopher Howard) Date: Sat, 14 May 2016 22:07:22 -0800 Subject: [Haskell-cafe] Confirmation Email for Hackage Account? In-Reply-To: <5738111E.9000302@zoho.com> References: <573807CB.1000002@zoho.com> <5738111E.9000302@zoho.com> Message-ID: <5738121A.6070306@zoho.com> Oh wait, I had an old account on there a few years ago, same name. Maybe that is the problem? I'd reset it, but the old email address is no longer available to me. On 05/14/2016 10:03 PM, Christopher Howard wrote: > Hi, I still haven't received the confirmation email, and I can't find it > in my spam folders. Is there a Hackage admin on the list who can help me > out? > > On 05/14/2016 09:23 PM, Christopher Howard wrote: >> Hi. How long does it usually take to receive the confirmation email for >> a hackage account registration? >> > -- http://justonemoremathproblem.com To protect my privacy, please use PGP encryption. It's free and easy to use! My public key ID is 0x340EA95A (pgp.mit.edu). From gershomb at gmail.com Sun May 15 06:14:24 2016 From: gershomb at gmail.com (Gershom B) Date: Sun, 15 May 2016 02:14:24 -0400 Subject: [Haskell-cafe] Confirmation Email for Hackage Account? In-Reply-To: <5738111E.9000302@zoho.com> References: <573807CB.1000002@zoho.com> <5738111E.9000302@zoho.com> <5738111E.9000302@zoho.com> Message-ID: I emailed Christopher offlist to take care of this. For those that aren?t aware, account issues can be handled by emailing?admin at hackage.haskell.org ?Gershom On May 15, 2016 at 2:03:25 AM, Christopher Howard (ch.howard at zoho.com) wrote: > Hi, I still haven't received the confirmation email, and I can't find it > in my spam folders. Is there a Hackage admin on the list who can help me > out? > > On 05/14/2016 09:23 PM, Christopher Howard wrote: > > Hi. How long does it usually take to receive the confirmation email for > > a hackage account registration? > > > > -- > http://justonemoremathproblem.com > To protect my privacy, please use PGP encryption. It's free and easy > to use! My public key ID is 0x340EA95A (pgp.mit.edu). > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > From alexey.muranov at gmail.com Sun May 15 15:20:29 2016 From: alexey.muranov at gmail.com (Alexey Muranov) Date: Sun, 15 May 2016 17:20:29 +0200 Subject: [Haskell-cafe] How about a special syntax for generalised (= MonadPlus) comprehension? Message-ID: <51772ABC-B053-4AE3-AA47-4D556DB5FC6E@gmail.com> If i understand correctly, the main reason that generalised comprehension was removed from Haskell 98 must have been that its syntax "collides" with the syntax for lists. Indeed, if ``` [x^2 | x <- msum (map return [0..10]), x `mod` 2 == 1] ``` is made ad-hoc polymorphic, then so probably should `[]` and `[1,2,3]`. Moreover, for consistency, the meaning of `[]` as the list type constructor (like in `[]Int` or `[Int]`), should probably be changed to denote an arbitrary instance of `MonadPlus` :). My question is: why not to have a special syntax for `MonadPlus` comprehension? For example: ``` {| x + y | x <- Just 1, y <- Just 2 |} ``` or ``` [* x + y | x <- Just 1, y <- Just 2 *] ``` Then matching analogs of `[]` and `[1,2,3]` could be made: ``` {||} :: Maybe Int -- Nothing {| Just 1, Just 2, Just 3 |} :: Maybe Int -- Just 1 ``` Alexey. From alexey.muranov at gmail.com Sun May 15 15:36:25 2016 From: alexey.muranov at gmail.com (Alexey Muranov) Date: Sun, 15 May 2016 08:36:25 -0700 (PDT) Subject: [Haskell-cafe] How about a special syntax for generalised (= MonadPlus) comprehension? In-Reply-To: <51772ABC-B053-4AE3-AA47-4D556DB5FC6E@gmail.com> References: <51772ABC-B053-4AE3-AA47-4D556DB5FC6E@gmail.com> Message-ID: <09225acf-b84c-4e1e-987e-597e8dec414c@googlegroups.com> On Sunday, May 15, 2016 at 5:20:42 PM UTC+2, Alexey Muranov wrote: > > Then matching analogs of `[]` and `[1,2,3]` could be made: > > ``` > {||} :: Maybe Int -- Nothing > {| Just 1, Just 2, Just 3 |} :: Maybe Int -- Just 1 > ``` > Sorry, i meant of course ``` {|1, 2, 3|} :: Maybe Int -- Just 1 ``` Alexey. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mainland at drexel.edu Mon May 16 17:03:38 2016 From: mainland at drexel.edu (Geoffrey Mainland) Date: Mon, 16 May 2016 13:03:38 -0400 Subject: [Haskell-cafe] [Final CFP] Haskell 2016 Message-ID: <5739FD6A.7080106@drexel.edu> ======================================================================== ACM SIGPLAN CALL FOR SUBMISSIONS Haskell Symposium 2016 Nara, Japan, 22-23 September 2016, directly after ICFP http://www.haskell.org/haskell-symposium/2016 ======================================================================== The ACM SIGPLAN Haskell Symposium 2016 will be co-located with the International Conference on Functional Programming (ICFP 2016) in Nara, Japan. The Haskell Symposium aims to present original research on Haskell, discuss practical experience and future development of the language, and to promote other forms of denotative programming. Topics of interest include: * Language Design, with a focus on possible extensions and modifications of Haskell as well as critical discussions of the status quo; * Theory, such as formal semantics of the present language or future extensions, type systems, effects, metatheory, and foundations for program analysis and transformation; * Implementations, including program analysis and transformation, static and dynamic compilation for sequential, parallel, and distributed architectures, memory management, as well as foreign function and component interfaces; * Libraries, that demonstrate new ideas or techniques for functional programming in Haskell; * Tools, such as profilers, tracers, debuggers, preprocessors, and testing tools; * Applications, to scientific and symbolic computing, databases, multimedia, telecommunication, the web, and so forth; * Functional Pearls, being elegant and instructive programming examples; * Experience Reports, to document general practice and experience in education, industry, or other contexts. Papers in the latter three categories need not necessarily report original academic research results. For example, they may instead report reusable programming idioms, elegant ways to approach a problem, or practical experience that will be useful to other users, implementors, or researchers. The key criterion for such a paper is that it makes a contribution from which other Haskellers can benefit. It is not enough simply to describe a standard solution to a standard programming problem, or report on experience where you used Haskell in the standard way and achieved the result you were expecting. More advice is available via the Haskell wiki: (http://wiki.haskell.org/HaskellSymposium/ExperienceReports) Regular papers should explain their research contributions in both general and technical terms, identifying what has been accomplished, explaining why it is significant, and relating it to previous work, and to other languages where appropriate. In addition, we solicit proposals for: * System Demonstrations, based on running software rather than novel research results. These proposals should summarize the system capabilities that would be demonstrated. The proposals will be judged on whether the ensuing session is likely to be important and interesting to the Haskell community at large, whether on grounds academic or industrial, theoretical or practical, technical, social or artistic. Please contact the program chair with any questions about the relevance of a proposal. Travel Support: =============== Student attendees with accepted papers can apply for a SIGPLAN PAC grant to help cover travel expenses. PAC also offers other support, such as for child-care expenses during the meeting or for travel costs for companions of SIGPLAN members with physical disabilities, as well as for travel from locations outside of North America and Europe. For details on the PAC program, see its web page (http://pac.sigplan.org). Proceedings: ============ Accepted papers will be included in the ACM Digital Library. Authors must grant ACM publication rights upon acceptance (http://authors.acm.org/main.html). Authors are encouraged to publish auxiliary material with their paper (source code, test data, etc.); they retain copyright of auxiliary material. Accepted proposals for system demonstrations will be posted on the symposium website but not formally published in the proceedings. All accepted papers and proposals will be posted on the conference website one week before the meeting. Publication date: The official publication date of accepted papers is the date the proceedings are made available in the ACM Digital Library. This date may be up to two weeks prior to the first day of the conference. The official publication date affects the deadline for any patent filings related to published work. Submission Details: =================== Submitted papers should be in portable document format (PDF), formatted using the ACM SIGPLAN style guidelines (http://www.acm.org/sigs/sigplan/authorInformation.htm). The text should be in a 9-point font in two columns. The length is restricted to 12 pages, except for "Experience Report" papers, which are restricted to 6 pages. Papers need not fill the page limit---for example, a Functional Pearl may be much shorter than 12 pages. Each paper submission must adhere to SIGPLAN's republication policy, as explained on the web. Demo proposals are limited to 2-page abstracts, in the same ACM format as papers. "Functional Pearls", "Experience Reports", and "Demo Proposals" should be marked as such with those words in the title at time of submission. The paper submission deadline and length limitations are firm. There will be no extensions, and papers violating the length limitations will be summarily rejected. Papers may be submitted at: https://icfp-haskell2016.hotcrp.com/ Submission Timetable: ===================== Early Track Regular Track System Demos ---------------- ------------------- --------------- 1st April Paper Submission 20th May Notification 6th June Abstract Submission 10th June Paper Submission 17th June Resubmission Demo Submission 8th July Notification Notification Notification 31st July Camera ready due Camera ready due Deadlines stated are valid anywhere on earth. The Haskell Symposium uses a two-track submission process so that some papers can gain early feedback. Papers can be submitted to the early track on 1st April. On 20th May, strong papers are accepted outright, and the others will be given their reviews and invited to resubmit. On 17th June, early track papers may be resubmitted and are sent back to the same reviewers. The Haskell Symposium regular track operates as in previous years. Papers accepted via the early and regular tracks are considered of equal value and will not be distinguished in the proceedings. Although all papers may be submitted to the early track, authors of functional pearls and experience reports are particularly encouraged to use this mechanism. The success of these papers depends heavily on the way they are presented, and submitting early will give the program committee a chance to provide feedback and help draw out the key ideas. Program Committee: =================== James Cheney University of Edinburgh Iavor Diatchki Galois David Duke University of Leeds Richard Eisenberg University of Pennsylvania Ken Friis Larsen University of Copenhagen Andy Gill University of Kansas Zhenjiang Hu National Institute of Informatics Ranjit Jhala UC San Diego Yukiyoshi Kameyama University of Tsukuba Geoffrey Mainland (chair) Drexel University Mary Sheeran Chalmers University of Technology David Terei Stanford Niki Vazou UC San Diego Dimitrios Vytiniotis Microsoft Research ===================================================================== From cbrolin at gmail.com Mon May 16 17:48:22 2016 From: cbrolin at gmail.com (Christian Brolin) Date: Mon, 16 May 2016 19:48:22 +0200 Subject: [Haskell-cafe] All combinations in order. Message-ID: <573A07E6.8020205@gmail.com> Hmm, I tried to post this via google groups but it was rejected. So I try to mail the list instead. Sorry for any duplicates. Hi list! How to transform a list of streams of elements into a stream of lists of elements such that all combinations of exactly one element of each input stream is present? I.e. something like this: | |type Streama =[a] |tr ::[Streame]->Stream[e] tr = sequence | But I want the order of the output lists so the ones with early elements come first. The above starts with the first elements from each stream but does not treat the streams fairly. All the elements of the last stream are used before the next element of the second last stream is used, i.e. | > tr [[1..3], [1..2], [1..3]] [[1,1,1],[1,1,2],[1,1,3],[1,2,1]..... | I don't want the third element of one stream before I have seen all the combinations of the first two elements of each stream and so on. In this case I want something like this: | [[1,1,1], [1,1,2], [1,2,1], [2,1,1], [1,2,2], [2,1,2], [2,2,1], [2,2,2], [1,1,3].... | Also [2,1,1] comes before [1,2,2] because the former contains two first element and one second element while the latter contains only one first element and two second elements. The number of streams are fairly low but the sequences can be very long (almost infinte :) and I want the first results without having to go though a full stream. Also the streams may vary in length so one stream may ran out of elements before the others. If that happens, the non-empty streams should contrbute fairly with new elements, i.e: | > sequence_ $ map print $ tr [[1..2], [3..5]] -- two times three equals to six combinations [1,3] -- 1: first and first [1,4] -- 2: first and second [2,3] -- 3: second and first [2,4] -- 4: second and second [1,5] -- 5: first and third [2,5] -- 6: second and third | Note, I'm not just interested to handle infinite streams (nor infinite number of streams) using some diagonal algorithm. I have looked at the Omega library. But it doesn't return the combinations in wanted order. If someone still wonder about the output ordering, the following program may help: | importData.List(sort,sortBy) type Streama =[a] tr ::Orde =>[Streame]->Stream[e] tr =sortBy myOrder .sequence wheremyOrder ::Orde =>[e]->[e]->Ordering myOrder xs ys =compare (reverse $ sort xs)(reverse $ sort ys) main =sequence_ $ map print$ tr [[1..3],[1..2],[1..3],[1..4]] | But this of course is not a valid solution since it inspects every combinations before producing any output. Attached the sample output. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- -*- mode: compilation; default-directory: "~/" -*- Compilation started at Mon May 16 19:23:20 ghc --make Comb && ./Comb [1 of 1] Compiling Main ( Comb.hs, Comb.o ) Linking Comb ... [1,1,1,1] [1,1,1,2] [1,1,2,1] [1,2,1,1] [2,1,1,1] [1,1,2,2] [1,2,1,2] [1,2,2,1] [2,1,1,2] [2,1,2,1] [2,2,1,1] [1,2,2,2] [2,1,2,2] [2,2,1,2] [2,2,2,1] [2,2,2,2] [1,1,1,3] [1,1,3,1] [3,1,1,1] [1,1,2,3] [1,1,3,2] [1,2,1,3] [1,2,3,1] [2,1,1,3] [2,1,3,1] [3,1,1,2] [3,1,2,1] [3,2,1,1] [1,2,2,3] [1,2,3,2] [2,1,2,3] [2,1,3,2] [2,2,1,3] [2,2,3,1] [3,1,2,2] [3,2,1,2] [3,2,2,1] [2,2,2,3] [2,2,3,2] [3,2,2,2] [1,1,3,3] [3,1,1,3] [3,1,3,1] [1,2,3,3] [2,1,3,3] [3,1,2,3] [3,1,3,2] [3,2,1,3] [3,2,3,1] [2,2,3,3] [3,2,2,3] [3,2,3,2] [3,1,3,3] [3,2,3,3] [1,1,1,4] [1,1,2,4] [1,2,1,4] [2,1,1,4] [1,2,2,4] [2,1,2,4] [2,2,1,4] [2,2,2,4] [1,1,3,4] [3,1,1,4] [1,2,3,4] [2,1,3,4] [3,1,2,4] [3,2,1,4] [2,2,3,4] [3,2,2,4] [3,1,3,4] [3,2,3,4] Compilation finished at Mon May 16 19:23:22 From rick at rickmurphy.org Mon May 16 19:13:34 2016 From: rick at rickmurphy.org (rick) Date: Mon, 16 May 2016 15:13:34 -0400 Subject: [Haskell-cafe] representing institutions in haskell Message-ID: <573A1BDE.20302@rickmurphy.org> Has anyone here taken an interest in representing institutions [1] in Haskell? Institutions originated in work on CLEAR [2] which was the first algebraic specification language with rigorous semantics. Institutions take some time to explain, or unravel if you follow the reference, but they come with a convenient slogan : "Truth is invariant under change of notation." The stretch goal of institutions is transforming logics while preserving satisfaction. They are conceived in terms of categorical abstractions, so it's natural to represent them in categories. I hope some folks here find institutions a useful domain to apply their work on categories. I've attached two samples in Haskell that uses some standard libraries : Arrow, Monad, Category and Dual. The first sample, ri-0, outlines the essentials. The category of signatures, constructions in the categories, signature morphisms, sentences, models and the satisfaction condition. Using plain old Nat reduces the complexity of the exposition. I provide a constructive witness for satisfaction of the morphism from conjunction to disjunction. You may recognize that I borrow some Bird/Hinze notation on Functors like mapSign. And you find some experiments with Quickcheck and Yampa. Ri-0 runs from main, but just computes the witness to the satisfaction condition. The second sample, ri-1, builds on ri-0. Rather than Nat, I use Either to inject disjunction into the exposition. The exposition becomes more complex, but the increased complexity is justified because maintaining satisfaction under change on notation is central to institutions. The functions prodSum takes conjunction to disjunction and sumProd takes disjunction to conjunction. I owe a citation to @BartoszMilewski and his work on categories for programmers where I first saw these functions. The satisfaction condition and witness appear more complex in ri-1, but its really just the substitution of the signature morphism on product and sum rather than plain old Nat as in ri-0. I also plan a better write up, but before I do I expect to learn much from an email exchange with interested folks here. Thanks for taking a look at this material. 1. https://cseweb.ucsd.edu/~goguen/pps/ins.ps 2. http://hopl.info/showlanguage.prx?exp=945 -- Rick -------------- next part -------------- A non-text attachment was scrubbed... Name: Main.hs Type: text/x-haskell Size: 7900 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Main.hs Type: text/x-haskell Size: 5982 bytes Desc: not available URL: From simon at joyful.com Mon May 16 21:26:37 2016 From: simon at joyful.com (Simon Michael) Date: Mon, 16 May 2016 14:26:37 -0700 Subject: [Haskell-cafe] ANN: new #haskell-atom channel, Atom setup doc Message-ID: <5dd94717-891c-ec93-65a2-00d7e7875e57@joyful.com> Hi all, Recently I helped a newcomer set up Haskell and Atom (the text editor/IDE - not the embedded systems DSL), and also for the first time succeeded in getting a "modern IDE experience" working with my own projects. I've saved my notes so far - I hope you'll also find them useful: https://github.com/simonmichael/haskell-atom-setup In the process I found some issues, looked for help in many places, and wished the #haskell-atom IRC channel existed. So I've started it: #haskell-atom on Freenode I'm an Emacs man, but I try all the available Haskell IDEs periodically. Atom is the first one where I've succeeded in getting inline error reporting working, and it's the only one I could recommend to a new programmer or a mainstream IDE lover right now. So I think this channel is worth having, and will grow. All welcome! Best, -Simon From wren at community.haskell.org Tue May 17 00:40:32 2016 From: wren at community.haskell.org (wren romano) Date: Mon, 16 May 2016 20:40:32 -0400 Subject: [Haskell-cafe] All combinations in order. In-Reply-To: <573A07E6.8020205@gmail.com> References: <573A07E6.8020205@gmail.com> Message-ID: On Mon, May 16, 2016 at 1:48 PM, Christian Brolin wrote: > Hmm, I tried to post this via google groups but it was rejected. So I try to > mail the list instead. Sorry for any duplicates. > > Hi list! > > How to transform a list of streams of elements into a stream of lists of > elements such that all combinations of exactly one element of each input > stream is present? I.e. something like this: > > type Stream a = [a] > tr :: [Stream e] -> Stream [e] > tr = sequence > > But I want the order of the output lists so the ones with early elements > come first. The above starts with the first elements from each stream but > does not treat the streams fairly. All the elements of the last stream are > used before the next element of the second last stream is used, i.e. For fair interleaving of streams, you should check out http://hackage.haskell.org/package/logict (And be sure to read the paper, not just the Haddock documentation) -- Live well, ~wren From david.feuer at gmail.com Tue May 17 21:19:45 2016 From: david.feuer at gmail.com (David Feuer) Date: Tue, 17 May 2016 17:19:45 -0400 Subject: [Haskell-cafe] Is there a way to query the availability of an extension? Or could we? Message-ID: We have __GLASGOW_HASKELL__ to tell us what GHC version we're running (if we're running GHC), and Cabal sets up MIN_VERSION_blah macros and (when applicable) the __HADDOCK_VERSION__ macro. But what if we're running some other compiler? It seems rather painful to have to write code that enables or disables various extensions based on what version N of compiler C happens to support. Not to mention that this is even a pain when just dealing with GHC, since it involves digging through release notes or waiting to see how Travis throws up. Is there some better way? If not, could we add one? __Have_ScopedTypeVariables__ could tell us if the ScopedTypeVariables extension is available. Then instead of saying "We need ScopedTypeVariables" when we can (painfully) do without, we can just use it precisely when we have it. From ezyang at mit.edu Tue May 17 21:22:26 2016 From: ezyang at mit.edu (Edward Z. Yang) Date: Tue, 17 May 2016 14:22:26 -0700 Subject: [Haskell-cafe] Is there a way to query the availability of an extension? Or could we? In-Reply-To: References: Message-ID: <1463520032-sup-7110@sabre> Hello David, This would be simple to add, since GHC 8.0 already generates macros for package versions. The relevant code is compiler/main/DriverPipeline.hs search for "MIN_VERSION". I would bikeshed the macro name a little; how about something like LANGUAGE_ScopedTypeVariables? Cheers, Edward Excerpts from David Feuer's message of 2016-05-17 14:19:45 -0700: > We have __GLASGOW_HASKELL__ to tell us what GHC version we're running > (if we're running GHC), and Cabal sets up MIN_VERSION_blah macros and > (when applicable) the __HADDOCK_VERSION__ macro. But what if we're > running some other compiler? It seems rather painful to have to write > code that enables or disables various extensions based on what version > N of compiler C happens to support. Not to mention that this is even a > pain when just dealing with GHC, since it involves digging through > release notes or waiting to see how Travis throws up. > > Is there some better way? If not, could we add one? > > __Have_ScopedTypeVariables__ > > could tell us if the ScopedTypeVariables extension is available. Then > instead of saying "We need ScopedTypeVariables" when we can > (painfully) do without, we can just use it precisely when we have it. From david.feuer at gmail.com Tue May 17 21:33:15 2016 From: david.feuer at gmail.com (David Feuer) Date: Tue, 17 May 2016 17:33:15 -0400 Subject: [Haskell-cafe] Is there a way to query the availability of an extension? Or could we? In-Reply-To: <1463520032-sup-7110@sabre> References: <1463520032-sup-7110@sabre> Message-ID: That name sounds fine. Whatever we do on this front won't become terribly practically relevant for several years, even if it makes it into the next Report, but it would be nice to have a better story in four or five years. On Tue, May 17, 2016 at 5:22 PM, Edward Z. Yang wrote: > Hello David, > > This would be simple to add, since GHC 8.0 already generates > macros for package versions. The relevant code is > compiler/main/DriverPipeline.hs search for "MIN_VERSION". > > I would bikeshed the macro name a little; how about something > like LANGUAGE_ScopedTypeVariables? > > Cheers, > Edward > > Excerpts from David Feuer's message of 2016-05-17 14:19:45 -0700: >> We have __GLASGOW_HASKELL__ to tell us what GHC version we're running >> (if we're running GHC), and Cabal sets up MIN_VERSION_blah macros and >> (when applicable) the __HADDOCK_VERSION__ macro. But what if we're >> running some other compiler? It seems rather painful to have to write >> code that enables or disables various extensions based on what version >> N of compiler C happens to support. Not to mention that this is even a >> pain when just dealing with GHC, since it involves digging through >> release notes or waiting to see how Travis throws up. >> >> Is there some better way? If not, could we add one? >> >> __Have_ScopedTypeVariables__ >> >> could tell us if the ScopedTypeVariables extension is available. Then >> instead of saying "We need ScopedTypeVariables" when we can >> (painfully) do without, we can just use it precisely when we have it. From _deepfire at feelingofgreen.ru Tue May 17 22:19:41 2016 From: _deepfire at feelingofgreen.ru (Kosyrev Serge) Date: Wed, 18 May 2016 01:19:41 +0300 Subject: [Haskell-cafe] Is there a way to query the availability of an extension? Or could we? In-Reply-To: (David Feuer's message of "Tue, 17 May 2016 17:33:15 -0400") References: <1463520032-sup-7110@sabre> Message-ID: <87twhw1g5e.fsf@feelingofgreen.ru> David Feuer writes: > That name sounds fine. Whatever we do on this front won't become > terribly practically relevant for several years, even if it makes it > into the next Report, but it would be nice to have a better story in > four or five years. I find it disturbing on several dimensions, that something as ugly as CPP is discussed as a potentially standart part of Haskell. -- ? ???????e? / respectfully, ??????? ?????? From silvio.frischi at gmail.com Wed May 18 21:53:19 2016 From: silvio.frischi at gmail.com (Silvio Frischknecht) Date: Wed, 18 May 2016 23:53:19 +0200 Subject: [Haskell-cafe] What's your favorite flavor of Iterator type Message-ID: Hello, We know about Foldable, but sometimes you just want more functionality like: give me the rest of the string! Or a function to build pieces back together. I've been experimenting a bit and come up with 6 flavors of Iterators that do the same thing. Of course they all work for containers like ByteStrings, Text. 1) Haskell98 version (I like) data Iterator98 list ele = Iterator98 { next98 :: Maybe (ele, Iterator98 list ele), ... rest98 :: list, concat98 :: [list] -> list } -- How we can create an Iterator98 listIter98 :: [a] -> Iterator98 [a] a -- How the sum type looks sum98 :: (Num n) => Iterator98 listN n -> n Performance: *3 I'll also usually give the type of the constructor and sum functions. I also benchmarked the sum functions for [] and compared them to the best sum function I could come up with (which is significantly faster than the sum in Prelude!!! because it's strict. Whoever came up with the idea of making it non-strict, must have been drunk at the time :)). I like how handy and simple typed the Haskell98 version is. There are absolutely no superfluous Types or Contexts. However, *3 is quite a heavy penalty and it might even get worse when more functions are added. 2) Haskell98 Explicit (ambivalent) data IteratorExplicit98 iter list ele = IteratorExplicit98 { iterExplicit98 :: iter, nextExplicit98 :: iter -> Maybe (ele, iter) ... restExplicit98 :: iter -> list } listIterExplicit98 :: [a] -> IteratorExplicit98 [a] [a] a sumExplicit98 :: (Num n) => IteratorExplicit98 it list n -> n Performance: *1 It is explicit and it is still quite nice to use. There is however always that extra argument. Note: `iter` and `list` could potentially be different (in all examples). They are in Haskell however usually the same. Performance could be different, if you create and destroy a lot of data of type IteratorExplicit98. However, that won't usually be the case. 3) TypeFamilies (I don't like) class IteratorTF i where type ListTF i type ElemTF i nextTF :: i -> Maybe (ElemTF i, i) ... restTF :: i -> ListTF i instance IteratorTF2Class [ele] ele where ... sumTF :: (Num n, IteratorTF it, ElemTF it ~ n) => it -> n Performance: *1 I used to like type families. But now I'm a bit fed up with ~ contexts. This would be the "Rust" version. Interesting point: List and Elem functions could be separated into two classes. I.e. Note that no list type exists in the type of "sum". 4) TypeFamilies2 (ambivalent) class IteratorTF2Class list ele where data IteratorTF2 list ele nextTF2 :: IteratorTF2 list ele -> Maybe (ele, IteratorTF2 list ele) ... restTF2 :: IteratorTF2 list ele -> list instance IteratorTF2Class [ele] ele where data IteratorTF2 [ele] ele = ListIterTF2 [ele] sumTF2 :: (Num n, IteratorTF2Class list n) => IteratorTF2 list n -> n Performance: *1 Better than the last. However, IteratorTF2Class, IteratorTF2 are two Type-ish things where one would be preferred. This is my preferred method where all functions are carried in the type. 5) MultiParameterTypeClasses and Functional Dependencies (ambivalent) class IteratorMPTC iter list ele | iter -> list, iter -> ele where nextMPTC :: iter -> Maybe (ele, iter) ... restMPTC :: iter -> list instance IteratorMPTC [a] [a] a where sumMPTC :: (Num n, IteratorMPTC it list n) => it -> n Performance: *1 About the same as 3). The user will still be exposed to various individual types ":: it". That is not as bad as it is in "Rust", since (as already stated) in Haskell usually "list == it". This is similar to the parsec approach. class (Monad m) => Stream iter m ele | iter -> ele Parsec has no "rest" function so the "list" type is not needed. But they have an additional monad type. 6) Existential Quantification (my favorite) data IteratorEQ list ele = forall iter . IteratorEQ { iterEQ :: iter, nextEQ :: iter -> Maybe (ele, iter) ... restEQ :: iter -> list } listIterEQ :: [a] -> IteratorEQ [a] a sumEQ :: (Num n) => IteratorEQ list n -> n Performance: *1 Looks as nice as Haskell98 and is as fast as Haskell98Explicit. Btw. This is probably how It would be done in "C" with iter = void*. Additional thoughts: * Do we really need the "list" type. Couldn't we simply return iterators instead of the original "list" type. In 3) and 5), they will *usually* be the same anyway. * In 3) and 5) the typeclasses could be split to separate ele and list. * On the other hand combining Iterators will be very annoying for 3) and 5) data ZipIterator ... instance IteratorMPTC (ZipIterator (?) (elem, elem')) ? (elem, elem') where zip :: (IteratorMPTC iter list elem, IteratorMPTC iter' list' elem') -> ZipIterator ? (elem, elem') Which is your favorite? Why? Did I forget any good ones? Cheers Silvio -------------- next part -------------- {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE FlexibleContexts #-} import Criterion.Main import Data.Foldable import Data.Word import qualified Data.ByteString as BS listNext :: [a] -> Maybe (a,[a]) listNext (a:as) = Just (a,as) listNext [] = Nothing data Iterator98 list ele = Iterator98 { next98 :: Maybe (ele, Iterator98 list ele) } listIter98 :: [a] -> Iterator98 [a] a listIter98 (x:xs) = Iterator98 $ Just (x, listIter98 xs) listIter98 [] = Iterator98 $ Nothing sum98 :: (Num n) => Iterator98 listN n -> n sum98 iter = rec iter 0 where rec (Iterator98 iter') sum' = case iter' of (Just (ele,rest)) -> rec rest $! (sum' + ele) Nothing -> sum' data IteratorExplicit98 iter list ele = IteratorExplicit98 { iterExplicit98 :: iter, nextExplicit98 :: iter -> Maybe (ele, iter) } listIterExplicit98 :: [a] -> IteratorExplicit98 [a] [a] a listIterExplicit98 list = IteratorExplicit98 list listNext sumExplicit98 :: (Num n) => IteratorExplicit98 it list n -> n sumExplicit98 (IteratorExplicit98 iter nextF) = rec iter 0 where rec iter' sum' = case nextF iter' of (Just (ele,rest)) -> rec rest $! (sum' + ele) Nothing -> sum' class IteratorTF i where type ListTF i type ElemTF i nextTF :: i -> Maybe (ElemTF i, i) instance IteratorTF [a] where type ListTF [a] = [a] type ElemTF [a] = a nextTF (c:str) = Just (c,str) nextTF [] = Nothing sumTF :: (Num n, IteratorTF it, ElemTF it ~ n) => it -> n sumTF it' = rec it' 0 where rec it sum' = case nextTF it of (Just (c,n)) -> rec n $! (sum' + c) Nothing -> sum' class IteratorTF2Class list ele where data IteratorTF2 list ele nextTF2 :: IteratorTF2 list ele -> Maybe (ele, IteratorTF2 list ele) instance IteratorTF2Class [ele] ele where data IteratorTF2 [ele] ele = ListIterTF2 [ele] nextTF2 (ListIterTF2 []) = Nothing nextTF2 (ListIterTF2 (x:xs)) = Just (x, ListIterTF2 xs) sumTF2 :: (Num n, IteratorTF2Class list n) => IteratorTF2 list n -> n sumTF2 it' = rec it' 0 where rec it sum' = case nextTF2 it of (Just (c,n)) -> rec n $! (sum' + c) Nothing -> sum' class IteratorMPTC iter list ele | iter -> list, iter -> ele where nextMPTC :: iter -> Maybe (ele, iter) instance IteratorMPTC [a] [a] a where nextMPTC (c:str) = Just (c,str) nextMPTC [] = Nothing sumMPTC :: (Num n, IteratorMPTC it list n) => it -> n sumMPTC it' = rec it' 0 where rec it sum' = case nextMPTC it of (Just (c,n)) -> rec n $! (sum' + c) Nothing -> sum' data IteratorEQ list ele = forall iter . IteratorEQ { iterEQ :: iter, nextEQ :: iter -> Maybe (ele, iter) } listIterEQ :: [a] -> IteratorEQ [a] a listIterEQ list = IteratorEQ list listNext sumEQ :: (Num n) => IteratorEQ list n -> n sumEQ (IteratorEQ iter nextF) = rec iter 0 where rec iter' sum' = case nextF iter' of (Just (c,n)) -> rec n $! (sum' + c) Nothing -> sum' explicitSum :: (Num n) => [n] -> n explicitSum l' = rec l' 0 where rec (c:n) s = rec n $! (s + c) rec [] s = s n = 1000000 l = replicate n 5 bs = BS.pack l main = do last l `seq` return () defaultMain [ bgroup "list" [ bench "Prelude sum" $ whnf sum l, bench "Prelude foldl'" $ whnf (foldl' (+) 0) l, bench "explicit sum" $ whnf explicitSum l, bench "Iterator 98" $ whnf (sum98 . listIter98) l, bench "Iterator explicit 98" $ whnf (sumExplicit98 . listIterExplicit98) l, bench "Iterator type families" $ whnf sumTF l, bench "Iterator type families 2" $ whnf (sumTF2 . ListIterTF2) l, bench "Iterator multiparameter typeclasse" $ whnf sumMPTC l, bench "Iterator Existential Quantification" $ whnf (sumEQ . listIterEQ) l ], bgroup "bytestring" [ bench "foldl'" $ whnf (BS.foldl' (+) 0) bs ] ] From mihai.maruseac at gmail.com Wed May 18 23:46:56 2016 From: mihai.maruseac at gmail.com (Mihai Maruseac) Date: Wed, 18 May 2016 19:46:56 -0400 Subject: [Haskell-cafe] ANNOUNCE: Haskell Communities and Activities Report (30th ed., May 2016) Message-ID: On behalf of all the contributors, we are pleased to announce that the Haskell Communities and Activities Report (30th edition, May 2016) is now available, in PDF and HTML formats: http://haskell.org/communities/05-2016/report.pdf http://haskell.org/communities/05-2016/html/report.html All previous editions of HCAR can be accessed on the wiki at https://wiki.haskell.org/Haskell_Communities_and_Activities_Report Many thanks go to all the people that contributed to this report, both directly, by sending in descriptions, and indirectly, by doing all the interesting things that are reported. We hope you will find it as interesting a read as we did. If you have not encountered the Haskell Communities and Activities Reports before, you may like to know that the first of these reports was published in November 2001. Their goal is to improve the communication between the increasingly diverse groups, projects, and individuals working on, with, or inspired by Haskell. The idea behind these reports is simple: Every six months, a call goes out to all of you enjoying Haskell to contribute brief summaries of your own area of work. Many of you respond (eagerly, unprompted, and sometimes in time for the actual deadline) to the call. The editors collect all the contributions into a single report and feed that back to the community. When we try for the next update, six months from now, you might want to report on your own work, project, research area or group as well. So, please put the following into your diaries now: ======================================== End of September 2016: target deadline for contributions to the November 2016 edition of the HCAR Report ======================================== Unfortunately, many Haskellers working on interesting projects are so busy with their work that they seem to have lost the time to follow the Haskell related mailing lists and newsgroups, and have trouble even finding time to report on their work. If you are a member, user or friend of a project so burdened, please find someone willing to make time to report and ask them to "register" with the editors for a simple e-mail reminder in November (you could point us to them as well, and we can then politely ask if they want to contribute, but it might work better if you do the initial asking). Of course, they will still have to find the ten to fifteen minutes to draw up their report, but maybe we can increase our coverage of all that is going on in the community. Feel free to circulate this announcement further in order to reach people who might otherwise not see it. Enjoy! -- Mihai Maruseac (MM) "If you can't solve a problem, then there's an easier problem you can solve: find it." -- George Polya From anton.kholomiov at gmail.com Thu May 19 08:43:02 2016 From: anton.kholomiov at gmail.com (Anton Kholomiov) Date: Thu, 19 May 2016 11:43:02 +0300 Subject: [Haskell-cafe] ANNOUNCE: Haskell Communities and Activities Report (30th ed., May 2016) In-Reply-To: References: Message-ID: Great news! Thanks for putting it all together! 2016-05-19 2:46 GMT+03:00 Mihai Maruseac : > On behalf of all the contributors, we are pleased to announce that the > > Haskell Communities and Activities Report > (30th edition, May 2016) > > is now available, in PDF and HTML formats: > > http://haskell.org/communities/05-2016/report.pdf > http://haskell.org/communities/05-2016/html/report.html > > All previous editions of HCAR can be accessed on the wiki at > https://wiki.haskell.org/Haskell_Communities_and_Activities_Report > > Many thanks go to all the people that contributed to this report, > both directly, by sending in descriptions, and indirectly, by doing > all the interesting things that are reported. We hope you will find > it as interesting a read as we did. > > If you have not encountered the Haskell Communities and Activities > Reports before, you may like to know that the first of these reports > was published in November 2001. Their goal is to improve the > communication between the increasingly diverse groups, projects, and > individuals working on, with, or inspired by Haskell. The idea behind > these reports is simple: > > Every six months, a call goes out to all of you enjoying Haskell to > contribute brief summaries of your own area of work. Many of you > respond (eagerly, unprompted, and sometimes in time for the actual > deadline) to the call. The editors collect all the contributions > into a single report and feed that back to the community. > > When we try for the next update, six months from now, you might want > to report on your own work, project, research area or group as well. > So, please put the following into your diaries now: > > ======================================== > End of September 2016: > target deadline for contributions to the > November 2016 edition of the HCAR Report > ======================================== > > Unfortunately, many Haskellers working on interesting projects are so > busy with their work that they seem to have lost the time to follow > the Haskell related mailing lists and newsgroups, and have trouble even > finding time to report on their work. If you are a member, user or > friend of a project so burdened, please find someone willing to make > time to report and ask them to "register" with the editors for a simple > e-mail reminder in November (you could point us to them as well, and we > can then politely ask if they want to contribute, but it might work > better if you do the initial asking). Of course, they will still have to > find the ten to fifteen minutes to draw up their report, but maybe we > can increase our coverage of all that is going on in the community. > > Feel free to circulate this announcement further in order to > reach people who might otherwise not see it. Enjoy! > > -- > Mihai Maruseac (MM) > "If you can't solve a problem, then there's an easier problem you can > solve: find it." -- George Polya > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mblazevic at stilo.com Thu May 19 13:35:17 2016 From: mblazevic at stilo.com (=?UTF-8?Q?Mario_Bla=c5=beevi=c4=87?=) Date: Thu, 19 May 2016 09:35:17 -0400 Subject: [Haskell-cafe] How about a special syntax for generalised (= MonadPlus) comprehension? In-Reply-To: <51772ABC-B053-4AE3-AA47-4D556DB5FC6E@gmail.com> References: <51772ABC-B053-4AE3-AA47-4D556DB5FC6E@gmail.com> Message-ID: <573DC115.1080708@stilo.com> On 2016-05-15 11:20 AM, Alexey Muranov wrote: > If i understand correctly, the main reason that generalised comprehension was > removed from Haskell 98 must have been that its syntax "collides" with the > syntax for lists. Sorry about the late response. I don't know about Haskell 98, but there already is a GHC language extension for what you're looking for: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/syntax-extns.html#monad-comprehensions > Indeed, if > > ``` > [x^2 | x <- msum (map return [0..10]), x `mod` 2 == 1] > ``` > > is made ad-hoc polymorphic, then so probably should `[]` and `[1,2,3]`. > > Moreover, for consistency, the meaning of `[]` as the list type constructor > (like in `[]Int` or `[Int]`), should probably be changed to denote an > arbitrary instance of `MonadPlus` :). Yes, that is probably the reason the extension as it stands won't be made a part of the standard language. On the other hand, having to request it explicitly still seems like a lesser evil than adding new syntax to support it. > My question is: why not to have a special syntax for `MonadPlus` > comprehension? For example: > > ``` > {| x + y | x <- Just 1, y <- Just 2 |} > ``` > > or > > ``` > [* x + y | x <- Just 1, y <- Just 2 *] > ``` > > Then matching analogs of `[]` and `[1,2,3]` could be made: > > ``` > {||} :: Maybe Int -- Nothing > {| Just 1, Just 2, Just 3 |} :: Maybe Int -- Just 1 > ``` > > Alexey. From alexey.muranov at gmail.com Thu May 19 14:23:05 2016 From: alexey.muranov at gmail.com (Alexey Muranov) Date: Thu, 19 May 2016 07:23:05 -0700 (PDT) Subject: [Haskell-cafe] How about a special syntax for generalised (= MonadPlus) comprehension? In-Reply-To: <573DC115.1080708@stilo.com> References: <51772ABC-B053-4AE3-AA47-4D556DB5FC6E@gmail.com> <573DC115.1080708@stilo.com> Message-ID: Ok. My motivation for suggesting a special syntax for MonadPlus comprehension was that, generally speaking, it feels weird that in the standard Haskell there is a special syntax for a unique data structure. Even Python has it for lists, dictionaries, and sets. I understand well the motivation for leaving list comprehension on its own, but having simultaneously a similar syntax for a more general purpose would make it less weird IMO. Alexey. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gdweber at iue.edu Thu May 19 18:12:27 2016 From: gdweber at iue.edu (gdweber at iue.edu) Date: Thu, 19 May 2016 14:12:27 -0400 Subject: [Haskell-cafe] ANNOUNCE: Sifflet 2.3.0 - recursion learning aid / visual programming language Message-ID: <20160519181227.GA2539@sparrow.localnet> Sifflet 2.3.0 is now available on Hackage. This release brings Sifflet up to date, so it compiles with GHC 7.10.3, newer versions of depended-on libraries, and builds in a cabal sandbox. Sifflet is the visual, functional programming language and support system for students learning about recursion. Sifflet programmers define functions by drawing diagrams, and the Sifflet interpreter uses the diagrams to show how function calls are evaluated. The Sifflet library (formerly sifflet-lib package) is reintegrated into, and deprecated in favor of, the sifflet package. A test suite is added. Personal Note ------------- It's been about 18 months since I've been able to work on this project or do any serious Haskell development. A lot has changed in the Haskell world -- a lot of catching up to do! It feels good getting back to Haskell again. About Sifflet ------------- Sifflet is a visual, functional programming language intended as an aid for learning about recursion. * A picture explains Sifflet better than words: please see the screenshot showing how to evaluate 3!: http://pages.iu.edu/~gdweber/software/sifflet/home.html * Features: - Visual editor. - Visual tracer/debugger which shows how recursive and other function calls are evaluated. To support active learning and avoid screen clutter, Sifflet displays only as much of the computation as the user requests. - Carefully crafted tutorial with 44 pictures, about 26 pages if printed. - Number, string, and list data types. - Small collection of primitive functions. - Runnable examples of compound functions. - Sifflet functions can be exported to Scheme, Python 3, and Haskell. References ---------- * Download: http://hackage.haskell.org/package/sifflet * Home page: http://pages.iu.edu/~gdweber/software/sifflet/home.html * Sifflet Tutorial: http://pages.iu.edu/~gdweber/software/sifflet/doc/tutorial.html * Change log: http://pages.iu.edu/~gdweber/software/sifflet/ChangeLog.html -- Gregory D. Weber, Ph. D. http://pages.iu.edu/~gdweber/ Associate Professor of Informatics Tel (765) 973-8420 Indiana University East FAX (765) 973-8550 From epsilonhalbe at gmail.com Thu May 19 22:16:22 2016 From: epsilonhalbe at gmail.com (Martin Heuschober) Date: Fri, 20 May 2016 00:16:22 +0200 Subject: [Haskell-cafe] ANNOUNCE: accelerate-typelits Message-ID: I want to announce my first haskell project big/clean enough so I consider it possibly useful to others - accelerate-typelits is a library that provides vectors/matrices in a typesafe way - i.e. The dimension of the entities are stored on type level as (Nats). There is basic vector/matrix functionality, documentation and tests for those functions (mostly properties). If I have time I will provide some basic examples and a bit more complicated example within the next week. It is available on hackage https://hackage.haskell.org/package/accelerate-typelits as well as on github https://github.com/epsilonhalbe/accelerate-typelits. I would be happy to get some feedback. - Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: From bergey at teallabs.org Thu May 19 23:12:29 2016 From: bergey at teallabs.org (Daniel Bergey) Date: Thu, 19 May 2016 19:12:29 -0400 Subject: [Haskell-cafe] What's your favorite flavor of Iterator type In-Reply-To: References: Message-ID: <87eg8xzlpe.fsf@chladni.i-did-not-set--mail-host-address--so-tickle-me> [] is my favorite iterator, and the most common in Haskell. In many languages, iterators delay the tail of the sequence, so that the entire sequence does not need to be stored in memory. In Haskell, laziness is pervasive; lists benefit without any extra code. This makes lists in Haskell much more useful than singly linked lists in most strict languages. Pattern matching on (x:xs) is equivalent to your `next`. `tail` is your `rest`. `unpack` for ByteString and Text, and Data.Foldable.toList for many other types, produce a list. Did I miss any important operations on iterators? cheers, bergey On 2016-05-18 at 17:53, Silvio Frischknecht wrote: > Hello, > > We know about Foldable, but sometimes you just want more functionality > like: give me the rest of the string! Or a function to build pieces back > together. I've been experimenting a bit and come up with 6 flavors of > Iterators that do the same thing. Of course they all work for containers > like ByteStrings, Text. > > > 1) Haskell98 version (I like) > > data Iterator98 list ele = Iterator98 { > next98 :: Maybe (ele, Iterator98 list ele), > ... > rest98 :: list, > concat98 :: [list] -> list > } > > -- How we can create an Iterator98 > listIter98 :: [a] -> Iterator98 [a] a > > -- How the sum type looks > sum98 :: (Num n) => Iterator98 listN n -> n > > Performance: *3 > > I'll also usually give the type of the constructor and sum functions. I > also benchmarked the sum functions for [] and compared them to the best > sum function I could come up with (which is significantly faster than > the sum in Prelude!!! because it's strict. Whoever came up with the idea > of making it non-strict, must have been drunk at the time :)). > > I like how handy and simple typed the Haskell98 version is. There are > absolutely no superfluous Types or Contexts. However, *3 is quite a > heavy penalty and it might even get worse when more functions are added. > > > 2) Haskell98 Explicit (ambivalent) > > data IteratorExplicit98 iter list ele = IteratorExplicit98 { > iterExplicit98 :: iter, > nextExplicit98 :: iter -> Maybe (ele, iter) > ... > restExplicit98 :: iter -> list > } > > listIterExplicit98 :: [a] -> IteratorExplicit98 [a] [a] a > > sumExplicit98 :: (Num n) => IteratorExplicit98 it list n -> n > > Performance: *1 > > It is explicit and it is still quite nice to use. There is however > always that extra argument. Note: `iter` and `list` could potentially be > different (in all examples). They are in Haskell however usually the > same. Performance could be different, if you create and destroy a lot of > data of type IteratorExplicit98. However, that won't usually be the case. > > > 3) TypeFamilies (I don't like) > > class IteratorTF i where > type ListTF i > type ElemTF i > nextTF :: i -> Maybe (ElemTF i, i) > ... > restTF :: i -> ListTF i > > instance IteratorTF2Class [ele] ele where > ... > > sumTF :: (Num n, IteratorTF it, ElemTF it ~ n) => it -> n > > Performance: *1 > > I used to like type families. But now I'm a bit fed up with ~ contexts. > This would be the "Rust" version. Interesting point: List and Elem > functions could be separated into two classes. I.e. Note that no list > type exists in the type of "sum". > > > 4) TypeFamilies2 (ambivalent) > > class IteratorTF2Class list ele where > data IteratorTF2 list ele > nextTF2 :: IteratorTF2 list ele -> Maybe (ele, IteratorTF2 list > ele) > ... > restTF2 :: IteratorTF2 list ele -> list > > instance IteratorTF2Class [ele] ele where > data IteratorTF2 [ele] ele = ListIterTF2 [ele] > > sumTF2 :: (Num n, IteratorTF2Class list n) => IteratorTF2 list n -> n > > Performance: *1 > > Better than the last. However, IteratorTF2Class, IteratorTF2 are two > Type-ish things where one would be preferred. This is my preferred > method where all functions are carried in the type. > > > 5) MultiParameterTypeClasses and Functional Dependencies (ambivalent) > > class IteratorMPTC iter list ele | iter -> list, iter -> ele where > nextMPTC :: iter -> Maybe (ele, iter) > ... > restMPTC :: iter -> list > > instance IteratorMPTC [a] [a] a where > > sumMPTC :: (Num n, IteratorMPTC it list n) => it -> n > > Performance: *1 > > About the same as 3). The user will still be exposed to various > individual types ":: it". That is not as bad as it is in "Rust", since > (as already stated) in Haskell usually "list == it". This is similar to > the parsec approach. > > class (Monad m) => Stream iter m ele | iter -> ele > > Parsec has no "rest" function so the "list" type is not needed. But they > have an additional monad type. > > 6) Existential Quantification (my favorite) > > data IteratorEQ list ele = forall iter . IteratorEQ { > iterEQ :: iter, > nextEQ :: iter -> Maybe (ele, iter) > ... > restEQ :: iter -> list > } > > listIterEQ :: [a] -> IteratorEQ [a] a > > sumEQ :: (Num n) => IteratorEQ list n -> n > > Performance: *1 > > Looks as nice as Haskell98 and is as fast as Haskell98Explicit. Btw. > This is probably how It would be done in "C" with iter = void*. > > Additional thoughts: > > * Do we really need the "list" type. Couldn't we simply return iterators > instead of the original "list" type. In 3) and 5), they will *usually* > be the same anyway. > > * In 3) and 5) the typeclasses could be split to separate ele and list. > > * On the other hand combining Iterators will be very annoying for 3) and 5) > > data ZipIterator ... > instance IteratorMPTC (ZipIterator (?) (elem, elem')) ? (elem, > elem') where > zip :: (IteratorMPTC iter list elem, IteratorMPTC iter' list' > elem') -> ZipIterator ? (elem, elem') > > > Which is your favorite? Why? Did I forget any good ones? > > Cheers > > Silvio > {-# LANGUAGE FlexibleInstances #-} > {-# LANGUAGE TypeFamilies #-} > {-# LANGUAGE ExistentialQuantification #-} > {-# LANGUAGE MultiParamTypeClasses #-} > {-# LANGUAGE FunctionalDependencies #-} > {-# LANGUAGE FlexibleContexts #-} > import Criterion.Main > import Data.Foldable > import Data.Word > import qualified Data.ByteString as BS > > listNext :: [a] -> Maybe (a,[a]) > listNext (a:as) = Just (a,as) > listNext [] = Nothing > > data Iterator98 list ele = Iterator98 { > next98 :: Maybe (ele, Iterator98 list ele) > } > > listIter98 :: [a] -> Iterator98 [a] a > listIter98 (x:xs) = Iterator98 $ Just (x, listIter98 xs) > listIter98 [] = Iterator98 $ Nothing > > sum98 :: (Num n) => Iterator98 listN n -> n > sum98 iter = rec iter 0 where > rec (Iterator98 iter') sum' = case iter' of > (Just (ele,rest)) -> rec rest $! (sum' + ele) > Nothing -> sum' > > data IteratorExplicit98 iter list ele = IteratorExplicit98 { > iterExplicit98 :: iter, > nextExplicit98 :: iter -> Maybe (ele, iter) > } > > listIterExplicit98 :: [a] -> IteratorExplicit98 [a] [a] a > listIterExplicit98 list = IteratorExplicit98 list listNext > > sumExplicit98 :: (Num n) => IteratorExplicit98 it list n -> n > sumExplicit98 (IteratorExplicit98 iter nextF) = rec iter 0 where > rec iter' sum' = case nextF iter' of > (Just (ele,rest)) -> rec rest $! (sum' + ele) > Nothing -> sum' > > > class IteratorTF i where > type ListTF i > type ElemTF i > nextTF :: i -> Maybe (ElemTF i, i) > > instance IteratorTF [a] where > type ListTF [a] = [a] > type ElemTF [a] = a > nextTF (c:str) = Just (c,str) > nextTF [] = Nothing > > sumTF :: (Num n, IteratorTF it, ElemTF it ~ n) => it -> n > sumTF it' = rec it' 0 where > rec it sum' = case nextTF it of > (Just (c,n)) -> rec n $! (sum' + c) > Nothing -> sum' > > class IteratorTF2Class list ele where > data IteratorTF2 list ele > nextTF2 :: IteratorTF2 list ele -> Maybe (ele, IteratorTF2 list ele) > > instance IteratorTF2Class [ele] ele where > data IteratorTF2 [ele] ele = ListIterTF2 [ele] > nextTF2 (ListIterTF2 []) = Nothing > nextTF2 (ListIterTF2 (x:xs)) = Just (x, ListIterTF2 xs) > > sumTF2 :: (Num n, IteratorTF2Class list n) => IteratorTF2 list n -> n > sumTF2 it' = rec it' 0 where > rec it sum' = case nextTF2 it of > (Just (c,n)) -> rec n $! (sum' + c) > Nothing -> sum' > > class IteratorMPTC iter list ele | iter -> list, iter -> ele where > nextMPTC :: iter -> Maybe (ele, iter) > > instance IteratorMPTC [a] [a] a where > nextMPTC (c:str) = Just (c,str) > nextMPTC [] = Nothing > > sumMPTC :: (Num n, IteratorMPTC it list n) => it -> n > sumMPTC it' = rec it' 0 where > rec it sum' = case nextMPTC it of > (Just (c,n)) -> rec n $! (sum' + c) > Nothing -> sum' > > data IteratorEQ list ele = forall iter . IteratorEQ { > iterEQ :: iter, > nextEQ :: iter -> Maybe (ele, iter) > } > > listIterEQ :: [a] -> IteratorEQ [a] a > listIterEQ list = IteratorEQ list listNext > > sumEQ :: (Num n) => IteratorEQ list n -> n > sumEQ (IteratorEQ iter nextF) = rec iter 0 where > rec iter' sum' = case nextF iter' of > (Just (c,n)) -> rec n $! (sum' + c) > Nothing -> sum' > > explicitSum :: (Num n) => [n] -> n > explicitSum l' = rec l' 0 where > rec (c:n) s = rec n $! (s + c) > rec [] s = s > > n = 1000000 > l = replicate n 5 > bs = BS.pack l > > main = do > last l `seq` return () > defaultMain [ > bgroup "list" [ > bench "Prelude sum" $ whnf sum l, > bench "Prelude foldl'" $ whnf (foldl' (+) 0) l, > bench "explicit sum" $ whnf explicitSum l, > bench "Iterator 98" $ whnf (sum98 . listIter98) l, > bench "Iterator explicit 98" $ whnf (sumExplicit98 . listIterExplicit98) l, > bench "Iterator type families" $ whnf sumTF l, > bench "Iterator type families 2" $ whnf (sumTF2 . ListIterTF2) l, > bench "Iterator multiparameter typeclasse" $ whnf sumMPTC l, > bench "Iterator Existential Quantification" $ whnf (sumEQ . listIterEQ) l > ], > bgroup "bytestring" [ > bench "foldl'" $ whnf (BS.foldl' (+) 0) bs > ] > ] > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe From johannes.waldmann at htwk-leipzig.de Fri May 20 08:05:53 2016 From: johannes.waldmann at htwk-leipzig.de (Johannes Waldmann) Date: Fri, 20 May 2016 10:05:53 +0200 Subject: [Haskell-cafe] ANNOUNCE: accelerate-typelits Message-ID: > .. a library that provides vectors/matrices in a typesafe way Nice! But what does it have to do with accelarate :-) I mean, we could also use this somewhere in Data.Array? Else, it's re-invented all over the place - and poorly, e.g., https://github.com/jwaldmann/ersatz/blob/master/tests/Z001.hs#L51 - J.W. From dominic at steinitz.org Fri May 20 14:57:33 2016 From: dominic at steinitz.org (Dominic Steinitz) Date: Fri, 20 May 2016 14:57:33 +0000 (UTC) Subject: [Haskell-cafe] ANNOUNCE: accelerate-typelits References: Message-ID: > Martin Heuschober gmail.com> writes: > I want to announce my first haskell project big/clean enough so I > consider it possibly useful to others - accelerate-typelits is a > library that provides vectors/matrices in a typesafe way - i.e. The > dimension of the entities are stored on type level as (Nats). > It is available on hackage > https://hackage.haskell.org/package/accelerate-typelits as well as on > github?https://github.com/epsilonhalbe/accelerate-typelits. I would be happy to get some feedback. - Martin Hi Martin How does this differ from Numeric.LinearAlgebra.Static? https://hackage.haskell.org/package/hmatrix-0.17.0.1/docs/ Numeric-LinearAlgebra-Static.html http://dis.um.es/~alberto/hmatrix/static.html I use this extensively e.g. here is an extended Kalman filter implementation: https://hackage.haskell.org/package/Kalman-0.1.0.1/docs/Kalman.html With this I get speed (BLAS) and safety :-) Dominic. From dominic at steinitz.org Fri May 20 15:08:39 2016 From: dominic at steinitz.org (Dominic Steinitz) Date: Fri, 20 May 2016 15:08:39 +0000 (UTC) Subject: [Haskell-cafe] ANNOUNCE: accelerate-typelits References: Message-ID: Martin Heuschober gmail.com> writes: > > I would be happy to get some feedback. > I should also have said that if you use HEAD of haddock, it now supports mathjax so you can document your library much more nicely. Of course you then have to upload your documentation yourself but I think it's worth the effort. You can see a small example of how to use mathjax here: https://hackage.haskell.org/package/Kalman-0.1.0.1/docs/Kalman.html Dominic. From michael at schmong.org Fri May 20 16:47:17 2016 From: michael at schmong.org (Michael Litchard) Date: Fri, 20 May 2016 09:47:17 -0700 Subject: [Haskell-cafe] Modeling space for a MUD - revisited. Message-ID: This is a continuation of a conversation started in the following two links. https://groups.google.com/forum/#!searchin/haskell-cafe/michael$20litchard|sort:date/haskell-cafe/n0Tc29UUgoQ/iitt3z3PCwAJ https://groups.google.com/forum/#!searchin/haskell-cafe/michael$20litchard|sort:date/haskell-cafe/qD2kaZ9qpEA/jTDAp8KoCgAJ I am trying to model a 3-D space for a mudlike. Here's the criteria I have so far: (1) Objects in space will be either ships that can move or stationary things like non-moving game-controlled ships, space-stations , moons and planets. (2) Objects will not have spatial extent (3) Space is non-continuous (4) Collision happens only when one object is stationary or each moving objects are moving directly toward each other, on the same line. (5) Movement happens by setting a destination vector and a speed. There's no steering exactly, but you can change destination while moving, slow down or stop suddenly. (6) Octree looks like the data structure I want to use for modeling. I'm looking at http://hackage.haskell.org/package/Octree as best library for my application, if I am right about how to go about updating. I'm not sure I am. I think I can use the octree to track things in space, rather than having a node for each point. At most there will be say, 200 objects in space, therefore at most 200 nodes in the tree. So I am visualizing the following steps: (1) Begin with a [(Vector3 , a)]. This includes stationary objects and ships already in space. (2) If a new ship entered this space, add it to end of list. (3) make Octree a from above list (4) ships move by setting destination vector and then speed, calculate next Vector3 they will be at next tick (5) Make a new [(Vector3 , a)] (6) Go to (1) The first problem with this is in creating a new Octree from a list, when I would rather just recreate the new tree with a subtree of the nodes that changed. The library I am considering does not offer that operation. Maybe this is not a real problem considering the maximum objects in space will be 200. There may be other problems with my thinking here. I look to haskell-cafe for any insight it may offer. -------------- next part -------------- An HTML attachment was scrubbed... URL: From epsilonhalbe at gmail.com Fri May 20 19:27:23 2016 From: epsilonhalbe at gmail.com (Martin Heuschober) Date: Fri, 20 May 2016 21:27:23 +0200 Subject: [Haskell-cafe] ANNOUNCE: accelerate-typelits In-Reply-To: References: Message-ID: Hi! I did not know about Numeric.LinearAlgebra.Static - otherwise I would have hesitated to release my project in this state. Essentially it does a subset of the functionality provided, but the backend is not BLAS but accelerate, so it's usage might be different (I do not know enough about BLAS to give a well founded opinion on that). @JohannesWaldman - Now that I have seen the Numeric.LinearAlgebra.Static - library I have to admit - yes my approach is way less clean, though in my defense I didn't know about the other project. @Dominic - thanks for the information on haddock head - I love mathjax and fine documentation, I will definitely use this in future work. - Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: From dominic at steinitz.org Fri May 20 22:58:29 2016 From: dominic at steinitz.org (Dominic Steinitz) Date: Fri, 20 May 2016 15:58:29 -0700 Subject: [Haskell-cafe] ANNOUNCE: accelerate-typelits In-Reply-To: References: Message-ID: <39ce0ebf-0793-06ef-d766-38a37c04f7d9@steinitz.org> I should have said thank you for releasing it. On 20/05/2016 12:27, Martin Heuschober wrote: > Hi! > > I did not know about Numeric.LinearAlgebra.Static - otherwise I would > have hesitated to release my project in this state. > > Essentially it does a subset of the functionality provided, but the > backend is not BLAS but accelerate, so it's usage might be different > (I do not know enough about BLAS to give a well founded opinion on that). > > @JohannesWaldman - Now that I have seen > the Numeric.LinearAlgebra.Static - library I have to admit - yes my > approach is way less clean, though in my defense I didn't know about > the other project. > > @Dominic - thanks for the information on haddock head - I love mathjax > and fine documentation, I will definitely use this in future work. > > - Martin From manny at fpcomplete.com Fri May 20 23:16:39 2016 From: manny at fpcomplete.com (Emanuel Borsboom) Date: Fri, 20 May 2016 23:16:39 +0000 Subject: [Haskell-cafe] ANN: stack-1.1.2 Message-ID: Release notes: - Official FreeBSD binaries are now available ( #1253 ). Major changes: - Extensible custom snapshots implemented. These allow you to define snapshots which extend other snapshots. See #863 . Local file custom snapshots can now be safely updated without changing their name. Remote custom snapshots should still be treated as immutable. Behavior changes: - stack path --compiler was added in the last release, to yield a path to the compiler. Unfortunately, --compiler is a global option that is useful to use with stack path. The same functionality is now provided by stack path --compiler-exe. See #2123 - For packages specified in terms of a git or hg repo, the hash used in the location has changed. This means that existing downloads from older stack versions won?t be used. This is a side-effect of the fix to #2133 - stack upgrade no longer pays attention to local stack.yaml files, just the global config and CLI options. #1392 - stack ghci now uses :add instead of :load, making it potentially work better with user scripts. See #1888 Other enhancements: - Grab Cabal files via Git SHA to avoid regressions from Hackage revisions #2070 - Custom snapshots now support ghc-options. - Package git repos are now re-used rather than re-cloned. See #1620 - DESTDIR is filtered from environment when installing GHC. See #1460 - stack haddock now supports --hadock-arguments. See #2144 - Signing: warn if GPG_TTY is not set as per man gpg-agent Bug fixes: - Now ignore project config when doing stack init or stack new. See #2110 - Packages specified by git repo can now have submodules. See #2133 - Fix of hackage index fetch retry. See re-opening of #1418 - HPack now picks up changes to filesystem other than package.yaml. See #2051 - ?stack solver? no longer suggests ?omit-packages. See #2031 - Fixed an issue with building Cabal?s Setup.hs. See #1356 - Package dirtiness now pays attention to deleted files. See #1841 - stack ghci now uses extra-lib-dirs and extra-include-dirs. See #1656 - Relative paths outside of source dir added via qAddDependentFile are now checked for dirtiness. See #1982 - Signing: always use --with-fingerprints ------------------------------ Thanks to all our contributors for this release: - Benno F?nfst?ck @bennofs - Emanuel Borsboom @borsboom - Levi Notik @levinotik - Michael Sloan @mgsloan - Michael Snoyman @snoyberg - Oleg Grenrus @phadej - Sebastian Graf @sgraf812 - Simon Jakobi @sjakobi - Tim Dysinger @dysinger - Yann Esposito @yogsototh - Yuji Yamamoto @igrep And thanks also to the 150+ contributors to past releases! ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajnsit at gmail.com Sat May 21 06:44:31 2016 From: ajnsit at gmail.com (Anupam Jain) Date: Sat, 21 May 2016 12:14:31 +0530 Subject: [Haskell-cafe] Haskell Meetup group in Delhi, India Message-ID: Hi all, I just started a meetup group for Haskellers in and around Delhi NCR, India. The plan is to organise regular (monthly) meetups, talks, workshops etc for Haskell / FP enthusiasts at all skill levels. Anyone interested is welcome to join at - http://meetu.ps/c/2K4ft/FT8H/f. Also, since we are just getting started, the best way to help right now would be to spread the word! Thanks, Anupam Jain From ben at well-typed.com Sat May 21 15:18:35 2016 From: ben at well-typed.com (Ben Gamari) Date: Sat, 21 May 2016 17:18:35 +0200 Subject: [Haskell-cafe] [ANNOUNCE] GHC 8.0.1 is available! Message-ID: <8737pbxwvo.fsf@smart-cactus.org> =============================================== The Glasgow Haskell Compiler -- version 8.0.1 =============================================== The GHC developers are very pleased to announce the release of the first new super-major version of our Haskell compiler in six years, GHC 8.0.1. This release features dozens of exciting developments including, * A more refined interface for implicit call-stacks, allowing libraries to provide more helpful runtime error messages to users * The introduction of the DuplicateRecordFields language extension, allowing multiple record types to declare fields of the same name * Significant improvements in error message readability and content, including facilities for libraries to provide custom error messages, more aggressive warnings for fragile rewrite rules, and more helpful errors for missing imports * A rewritten and substantially more thorough pattern match checker, providing more precise exhaustiveness checking in GADT pattern matches * More reliable debugging information including experimental backtrace support, allowing better integration with traditional debugging tools * Support for desugaring do-notation to use Applicative combinators, allowing the intuitive do notation to be used in settings which previously required the direct use of Applicative combinators * The introduction of Strict and StrictData language extensions, allowing modules to be compiled with strict-by-default evaluation of bindings * Great improvements in portability, including more reliable linking on Windows, a new PPC64 code generator, support for the AIX operating system, unregisterised m68k support, and significant stabilization on ARM targets * A greatly improved user's guide, with beautiful and modern PDF and HTML output * Introduction of type application syntax, reducing the need for proxies * More complete support for pattern synonyms, including record pattern synonyms and the ability to export patterns "bundled" with a type, as you would a data constructor * Support for injective type families and recursive superclass relationships * An improved generics representation leveraging GHC's support for type-level literals * The TypeInType extension, which unifies types and kinds, allowing GHC to reason about kind equality and enabling promotion of more constructs to the type level * ...and more! A more thorough list of the changes included in this release can be found in the release notes, https://downloads.haskell.org/~ghc/8.0.1/docs/html/users_guide/8.0.1-notes.html As always, we have collected various points of interest for users of previous GHC releases on the GHC 8.0 migration page, https://ghc.haskell.org/trac/ghc/wiki/Migration/8.0 Please let us know if you encounter anything missing or unclear on this page. This release is the culmination of nearly eighteen months of effort by over one hundred contributors. We'd like to thank everyone who has contributed code, bug reports, and feedback over the past year. It's only because of their efforts that GHC continues to evolve. How to get it ~~~~~~~~~~~~~ Both the source tarball and binary distributions for a wide variety of platforms are available at, http://www.haskell.org/ghc/ Background ~~~~~~~~~~ Haskell is a standardized lazy functional programming language. The Glasgow Haskell Compiler (GHC) is a state-of-the-art programming suite for Haskell. Included is an optimising compiler generating efficient code for a variety of platforms, together with an interactive system for convenient, quick development. The distribution includes space and time profiling facilities, a large collection of libraries, and support for various language extensions, including concurrency, exceptions, and foreign language interfaces. GHC is distributed under a BSD-style open source license. Supported Platforms ~~~~~~~~~~~~~~~~~~~ The list of platforms we support, and the people responsible for them, can be found on the GHC wiki http://ghc.haskell.org/trac/ghc/wiki/Platforms Ports to other platforms are possible with varying degrees of difficulty. The Building Guide describes how to go about porting to a new platform: http://ghc.haskell.org/trac/ghc/wiki/Building Developers ~~~~~~~~~~ We welcome new contributors. Instructions on getting started with hacking on GHC are available from GHC's developer site, http://ghc.haskell.org/trac/ghc/ Community Resources ~~~~~~~~~~~~~~~~~~~ There are mailing lists for GHC users, develpoers, and monitoring bug tracker activity; to subscribe, use the web interfaces at http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets There are several other Haskell and GHC-related mailing lists on www.haskell.org; for the full list, see https://mail.haskell.org/cgi-bin/mailman/listinfo Some GHC developers hang out on the #ghc and #haskell of the Freenode IRC network, too: http://www.haskell.org/haskellwiki/IRC_channel Please report bugs using our bug tracking system. Instructions on reporting bugs can be found here: http://www.haskell.org/ghc/reportabug -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 472 bytes Desc: not available URL: From amindfv at gmail.com Sat May 21 15:39:31 2016 From: amindfv at gmail.com (amindfv at gmail.com) Date: Sat, 21 May 2016 11:39:31 -0400 Subject: [Haskell-cafe] [ANNOUNCE] GHC 8.0.1 is available! In-Reply-To: <8737pbxwvo.fsf@smart-cactus.org> References: <8737pbxwvo.fsf@smart-cactus.org> Message-ID: <41BA6C56-793E-4862-A3C0-B2782A22622F@gmail.com> Congratulations! Thank you everyone for all your hard work! Tom > El 21 may 2016, a las 11:18, Ben Gamari escribi?: > > > =============================================== > The Glasgow Haskell Compiler -- version 8.0.1 > =============================================== > > The GHC developers are very pleased to announce the release of the first > new super-major version of our Haskell compiler in six years, GHC 8.0.1. > > This release features dozens of exciting developments including, > > * A more refined interface for implicit call-stacks, allowing libraries to > provide more helpful runtime error messages to users > > * The introduction of the DuplicateRecordFields language extension, allowing > multiple record types to declare fields of the same name > > * Significant improvements in error message readability and content, including > facilities for libraries to provide custom error messages, more aggressive > warnings for fragile rewrite rules, and more helpful errors for missing > imports > > * A rewritten and substantially more thorough pattern match checker, providing > more precise exhaustiveness checking in GADT pattern matches > > * More reliable debugging information including experimental backtrace support, > allowing better integration with traditional debugging tools > > * Support for desugaring do-notation to use Applicative combinators, allowing > the intuitive do notation to be used in settings which previously required > the direct use of Applicative combinators > > * The introduction of Strict and StrictData language extensions, allowing > modules to be compiled with strict-by-default evaluation of bindings > > * Great improvements in portability, including more reliable linking on > Windows, a new PPC64 code generator, support for the AIX operating system, > unregisterised m68k support, and significant stabilization on ARM targets > > * A greatly improved user's guide, with beautiful and modern PDF and HTML > output > > * Introduction of type application syntax, reducing the need for proxies > > * More complete support for pattern synonyms, including record pattern synonyms > and the ability to export patterns "bundled" with a type, as you would a data > constructor > > * Support for injective type families and recursive superclass relationships > > * An improved generics representation leveraging GHC's support for type-level > literals > > * The TypeInType extension, which unifies types and kinds, allowing GHC to > reason about kind equality and enabling promotion of more constructs to the > type level > > * ...and more! > > A more thorough list of the changes included in this release can be found in the > release notes, > > https://downloads.haskell.org/~ghc/8.0.1/docs/html/users_guide/8.0.1-notes.html > > As always, we have collected various points of interest for users of previous > GHC releases on the GHC 8.0 migration page, > > https://ghc.haskell.org/trac/ghc/wiki/Migration/8.0 > > Please let us know if you encounter anything missing or unclear on this page. > > This release is the culmination of nearly eighteen months of effort by over one > hundred contributors. We'd like to thank everyone who has contributed code, bug > reports, and feedback over the past year. It's only because of their efforts > that GHC continues to evolve. > > > How to get it > ~~~~~~~~~~~~~ > > Both the source tarball and binary distributions for a wide variety of platforms > are available at, > > http://www.haskell.org/ghc/ > > > Background > ~~~~~~~~~~ > > Haskell is a standardized lazy functional programming language. > > The Glasgow Haskell Compiler (GHC) is a state-of-the-art programming suite for > Haskell. Included is an optimising compiler generating efficient code for a > variety of platforms, together with an interactive system for convenient, quick > development. The distribution includes space and time profiling facilities, a > large collection of libraries, and support for various language extensions, > including concurrency, exceptions, and foreign language interfaces. GHC is > distributed under a BSD-style open source license. > > > Supported Platforms > ~~~~~~~~~~~~~~~~~~~ > > The list of platforms we support, and the people responsible for them, can be > found on the GHC wiki > > http://ghc.haskell.org/trac/ghc/wiki/Platforms > > Ports to other platforms are possible with varying degrees of difficulty. The > Building Guide describes how to go about porting to a new platform: > > http://ghc.haskell.org/trac/ghc/wiki/Building > > > Developers > ~~~~~~~~~~ > > We welcome new contributors. Instructions on getting started with hacking on GHC > are available from GHC's developer site, > > http://ghc.haskell.org/trac/ghc/ > > > Community Resources > ~~~~~~~~~~~~~~~~~~~ > > There are mailing lists for GHC users, develpoers, and monitoring bug tracker > activity; to subscribe, use the web interfaces at > > http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users > http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs > http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets > > There are several other Haskell and GHC-related mailing lists on > www.haskell.org; for the full list, see > > https://mail.haskell.org/cgi-bin/mailman/listinfo > > Some GHC developers hang out on the #ghc and #haskell of the Freenode IRC > network, too: > > http://www.haskell.org/haskellwiki/IRC_channel > > Please report bugs using our bug tracking system. Instructions on reporting bugs > can be found here: > > http://www.haskell.org/ghc/reportabug > _______________________________________________ > Glasgow-haskell-users mailing list > Glasgow-haskell-users at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users From kc1956 at gmail.com Sat May 21 17:03:05 2016 From: kc1956 at gmail.com (KC) Date: Sat, 21 May 2016 10:03:05 -0700 Subject: [Haskell-cafe] [ANNOUNCE] GHC 8.0.1 is available! In-Reply-To: <41BA6C56-793E-4862-A3C0-B2782A22622F@gmail.com> References: <8737pbxwvo.fsf@smart-cactus.org> <41BA6C56-793E-4862-A3C0-B2782A22622F@gmail.com> Message-ID: Hopefully this makes it into the Haskell Platform soon Is it already in Stackage? ? -- -- Sent from an expensive device which will be obsolete in a few months! :D Casey On May 21, 2016 8:39 AM, wrote: > Congratulations! Thank you everyone for all your hard work! > > Tom > > > > El 21 may 2016, a las 11:18, Ben Gamari escribi?: > > > > > > =============================================== > > The Glasgow Haskell Compiler -- version 8.0.1 > > =============================================== > > > > The GHC developers are very pleased to announce the release of the first > > new super-major version of our Haskell compiler in six years, GHC 8.0.1. > > > > This release features dozens of exciting developments including, > > > > * A more refined interface for implicit call-stacks, allowing libraries > to > > provide more helpful runtime error messages to users > > > > * The introduction of the DuplicateRecordFields language extension, > allowing > > multiple record types to declare fields of the same name > > > > * Significant improvements in error message readability and content, > including > > facilities for libraries to provide custom error messages, more > aggressive > > warnings for fragile rewrite rules, and more helpful errors for missing > > imports > > > > * A rewritten and substantially more thorough pattern match checker, > providing > > more precise exhaustiveness checking in GADT pattern matches > > > > * More reliable debugging information including experimental backtrace > support, > > allowing better integration with traditional debugging tools > > > > * Support for desugaring do-notation to use Applicative combinators, > allowing > > the intuitive do notation to be used in settings which previously > required > > the direct use of Applicative combinators > > > > * The introduction of Strict and StrictData language extensions, allowing > > modules to be compiled with strict-by-default evaluation of bindings > > > > * Great improvements in portability, including more reliable linking on > > Windows, a new PPC64 code generator, support for the AIX operating > system, > > unregisterised m68k support, and significant stabilization on ARM > targets > > > > * A greatly improved user's guide, with beautiful and modern PDF and HTML > > output > > > > * Introduction of type application syntax, reducing the need for proxies > > > > * More complete support for pattern synonyms, including record pattern > synonyms > > and the ability to export patterns "bundled" with a type, as you would > a data > > constructor > > > > * Support for injective type families and recursive superclass > relationships > > > > * An improved generics representation leveraging GHC's support for > type-level > > literals > > > > * The TypeInType extension, which unifies types and kinds, allowing GHC > to > > reason about kind equality and enabling promotion of more constructs > to the > > type level > > > > * ...and more! > > > > A more thorough list of the changes included in this release can be > found in the > > release notes, > > > > > https://downloads.haskell.org/~ghc/8.0.1/docs/html/users_guide/8.0.1-notes.html > > > > As always, we have collected various points of interest for users of > previous > > GHC releases on the GHC 8.0 migration page, > > > > https://ghc.haskell.org/trac/ghc/wiki/Migration/8.0 > > > > Please let us know if you encounter anything missing or unclear on this > page. > > > > This release is the culmination of nearly eighteen months of effort by > over one > > hundred contributors. We'd like to thank everyone who has contributed > code, bug > > reports, and feedback over the past year. It's only because of their > efforts > > that GHC continues to evolve. > > > > > > How to get it > > ~~~~~~~~~~~~~ > > > > Both the source tarball and binary distributions for a wide variety of > platforms > > are available at, > > > > http://www.haskell.org/ghc/ > > > > > > Background > > ~~~~~~~~~~ > > > > Haskell is a standardized lazy functional programming language. > > > > The Glasgow Haskell Compiler (GHC) is a state-of-the-art programming > suite for > > Haskell. Included is an optimising compiler generating efficient code > for a > > variety of platforms, together with an interactive system for > convenient, quick > > development. The distribution includes space and time profiling > facilities, a > > large collection of libraries, and support for various language > extensions, > > including concurrency, exceptions, and foreign language interfaces. GHC > is > > distributed under a BSD-style open source license. > > > > > > Supported Platforms > > ~~~~~~~~~~~~~~~~~~~ > > > > The list of platforms we support, and the people responsible for them, > can be > > found on the GHC wiki > > > > http://ghc.haskell.org/trac/ghc/wiki/Platforms > > > > Ports to other platforms are possible with varying degrees of > difficulty. The > > Building Guide describes how to go about porting to a new platform: > > > > http://ghc.haskell.org/trac/ghc/wiki/Building > > > > > > Developers > > ~~~~~~~~~~ > > > > We welcome new contributors. Instructions on getting started with > hacking on GHC > > are available from GHC's developer site, > > > > http://ghc.haskell.org/trac/ghc/ > > > > > > Community Resources > > ~~~~~~~~~~~~~~~~~~~ > > > > There are mailing lists for GHC users, develpoers, and monitoring bug > tracker > > activity; to subscribe, use the web interfaces at > > > > > http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users > > http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs > > http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets > > > > There are several other Haskell and GHC-related mailing lists on > > www.haskell.org; for the full list, see > > > > https://mail.haskell.org/cgi-bin/mailman/listinfo > > > > Some GHC developers hang out on the #ghc and #haskell of the Freenode IRC > > network, too: > > > > http://www.haskell.org/haskellwiki/IRC_channel > > > > Please report bugs using our bug tracking system. Instructions on > reporting bugs > > can be found here: > > > > http://www.haskell.org/ghc/reportabug > > _______________________________________________ > > Glasgow-haskell-users mailing list > > Glasgow-haskell-users at haskell.org > > http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben at smart-cactus.org Sat May 21 17:07:53 2016 From: ben at smart-cactus.org (Ben Gamari) Date: Sat, 21 May 2016 19:07:53 +0200 Subject: [Haskell-cafe] [ANNOUNCE] GHC 8.0.1 is available! In-Reply-To: References: <8737pbxwvo.fsf@smart-cactus.org> <41BA6C56-793E-4862-A3C0-B2782A22622F@gmail.com> Message-ID: <87vb27wd92.fsf@smart-cactus.org> KC writes: > Hopefully this makes it into the Haskell Platform soon > I believe a Haskell Platform release is imminent, not sure about Stackage. Cheers, - Ben -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 472 bytes Desc: not available URL: From rahulmutt at gmail.com Sun May 22 02:54:28 2016 From: rahulmutt at gmail.com (Rahul Muttineni) Date: Sun, 22 May 2016 08:24:28 +0530 Subject: [Haskell-cafe] Interacting with Java in GHCVM Message-ID: Hi Haskell-Cafe, I've been working on a JVM backend for GHC [1] and I took some time to flesh out a design for the Java FFI [2] which will pretty much decide whether the project will be useful or not. I would love feedback from the community on how to improve the design or requests for important interop features that I have neglected. Thanks, Rahul Muttineni [1] http://github.com/rahulmutt/ghcvm [2] https://gist.github.com/rahulmutt/355505bce57c7c2cffd7d4cf5edddad4 -------------- next part -------------- An HTML attachment was scrubbed... URL: From voldermort at hotmail.com Sun May 22 07:17:43 2016 From: voldermort at hotmail.com (Jeremy .) Date: Sun, 22 May 2016 07:17:43 +0000 Subject: [Haskell-cafe] TDNR without new operators or syntax changes Message-ID: Yes, that it indeed was I meant. AntC seems to be replying to a much more complicated/invasive proposal than what I had intended, apologies if I wasn't clear. (I see in retrospect that I may have misunderstood the original TDNR proposal, understandably leading to confusion.) 1. If the compiler encounters a term f a, and there is more than one definition for f in scope (after following all of the usual rules for qualified imports); 2. And exactly one of these definitions matches the type of a (or the expected type of f if given); 3. Then this is the definition to use. That is all, although point 2 could be extended to consider the return type of f or other arguments as well. Even with the extension on, it would have no effect on programs which compile without it. This has nothing to do with ORF, which relies on magic type classes (although there is some overlap in what it can achieve). The primary use-case I had in mind is disambiguating name clashes between local and/or unqualified imports. Cross-posting to cafe and libraries as this doesn't seem to have attracted a lot of interest in users. Maybe it's just a boring proposal, maybe I didn't post it to the right list. -------------- next part -------------- An HTML attachment was scrubbed... URL: From alpmestan at gmail.com Sun May 22 07:35:08 2016 From: alpmestan at gmail.com (Alp Mestanogullari) Date: Sun, 22 May 2016 09:35:08 +0200 Subject: [Haskell-cafe] Interacting with Java in GHCVM In-Reply-To: References: Message-ID: Hi, For what it's worth, at Tweag we've developed some preliminary bindings to Apache Spark, and as part of this we developed a somewhat decent API for calling Java. You can check it out on hackage [1] and on github [2]. In cast that can save you some time or inspire you. [1]: http://hackage.haskell.org/package/inline-java [2]: https://github.com/tweag/sparkle -- see the inline-java directory On Sun, May 22, 2016 at 4:54 AM, Rahul Muttineni wrote: > Hi Haskell-Cafe, > > I've been working on a JVM backend for GHC [1] and I took some time to > flesh out a design for the Java FFI [2] which will pretty much decide > whether the project will be useful or not. I would love feedback from the > community on how to improve the design or requests for important interop > features that I have neglected. > > Thanks, > Rahul Muttineni > > [1] http://github.com/rahulmutt/ghcvm > [2] https://gist.github.com/rahulmutt/355505bce57c7c2cffd7d4cf5edddad4 > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > -- Alp Mestanogullari -------------- next part -------------- An HTML attachment was scrubbed... URL: From lemming at henning-thielemann.de Sun May 22 08:03:31 2016 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Sun, 22 May 2016 10:03:31 +0200 (CEST) Subject: [Haskell-cafe] TDNR without new operators or syntax changes In-Reply-To: References: Message-ID: On Sun, 22 May 2016, Jeremy . wrote: > 1. If the compiler encounters a term f a, and there is more than one definition for f in scope (after following all of > the usual rules for qualified imports); > > 2. And exactly one of these definitions matches?the?type of a (or the expected type of f if given); > > 3. Then this is the definition to use. I know people are unhappy with Haskell's records and module system, but I still think that's because these language features are not used properly. Type classes are the tool to write generic code and reduce combinatoric explosion of functions and modules are a way to collect functions per type. Following this principle you give function names that make sense together with the module name like File.write or Channel.write. Then there is no need for the compiler to disambiguate unqualified identifiers and you keep the type and the module issues separated. Today, if you stick to the unqualified style, and I guess you want to import modules without explicit identifier list, too, then your code can break whenever the imported modules add identifiers. In order to prevent this you have to use tight package import version bounds in your Cabal file. Your proposal would not solve this problem. Type-driven name resolution may disambiguate identifiers in some case but not in all ones, thus you still need to use tight version bounds. The proposal seems to be a big complication. The compiler can no longer emit a message: "Type of function f mismatch", but it has to emit "If f means A.f, then the type error would be ..., but if it means B.f, then the type error would be ..." Or even worse: "If f means A.f and g means C.g, then the type error would be ... if f means B.f and g means C.g ... or f means A.f and g means D.g ..." The proposal also is more error-prone, because if you make a type-error this could be shadowed by a function in scope with a type that matches accidentally. A function with a very generic type and a generic name might be such an accidental match. That said, the more complicated the proposals become the more one should reconsider about whether one runs in the right direction. I think this is the case here. The simple answer could be: Switch to a cleaner coding style! From davidescobar at ieee.org Sun May 22 08:16:48 2016 From: davidescobar at ieee.org (David Escobar) Date: Sun, 22 May 2016 01:16:48 -0700 Subject: [Haskell-cafe] Interacting with Java in GHCVM In-Reply-To: References: Message-ID: What about Frege? Haskell on the JVM with interop to Java libraries... https://github.com/Frege/frege On Sat, May 21, 2016 at 7:54 PM, Rahul Muttineni wrote: > Hi Haskell-Cafe, > > I've been working on a JVM backend for GHC [1] and I took some time to > flesh out a design for the Java FFI [2] which will pretty much decide > whether the project will be useful or not. I would love feedback from the > community on how to improve the design or requests for important interop > features that I have neglected. > > Thanks, > Rahul Muttineni > > [1] http://github.com/rahulmutt/ghcvm > [2] https://gist.github.com/rahulmutt/355505bce57c7c2cffd7d4cf5edddad4 > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan.miljenovic at gmail.com Sun May 22 14:23:30 2016 From: ivan.miljenovic at gmail.com (Ivan Lazar Miljenovic) Date: Mon, 23 May 2016 00:23:30 +1000 Subject: [Haskell-cafe] ANNOUNCE: testbench-0.1.0.0 Message-ID: I've just released a new library onto Hackage that aims to help you writing comparison-oriented benchmarks by: a) reducing the duplication found when using criterion directly b) let you test your benchmarked values/functions to ensure that they have the same result/satisfy a given predicate c) provide more comparison-oriented output I've written more about it here: https://ivanmiljenovic.wordpress.com/2016/05/23/test-your-benchmarks/ Or you could go straight to the Hackage page here: http://hackage.haskell.org/package/testbench -- Ivan Lazar Miljenovic Ivan.Miljenovic at gmail.com http://IvanMiljenovic.wordpress.com From bhurt at spnz.org Sun May 22 17:05:52 2016 From: bhurt at spnz.org (Brian Hurt) Date: Sun, 22 May 2016 13:05:52 -0400 Subject: [Haskell-cafe] Going insane over overlapping instances Message-ID: This is driving me nuts. So I have a type class HasStructParser I've defined. Details are irrelevant except that if you have HasStructParser defined, then ToJSON is also defined. So I have: instance HasStructParser s => ToJSON s where ... But now, any type that defines ToJSON any other way causes an Overlapping Instances error to happen- the conflict being between the real ToJSON implementation and the one deriving from HasStructParser- this despite the fact that there is no implementation for HasStructParser for the given type. Now, I don't want to allow Overlapping Instances because if there are *real* overlapping instances, I want that to be an error. For instance, if a structure did implement HasStructParser and some other implementation of ToJSON, I want to know. I suppose I could go: newtype JSON a = JSON a instance HasStructParser s => ToJSON (JSON s) where ... But this strikes me as being ugly- now I have to add pointless JSON constructors everywhere I want to convert to (or from) JSON. And this also pollutes my type signatures all over the place- now I can't write a servant endpoint type like: :<|> "foo" :> "bar" :> Get '[JSON] [Foo] I have to write: :<|> "foo" :> "bar" :> Get '[JSON] [JSON Foo] And, of course, if I want to have multiple different types of outputs, now we're off to the races. So my question is, is there a way to do this without throwing the baby out with the bath water (turning on overloaded instances) or being seriously ugly? Or am I just screwed? Brian -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at schmong.org Sun May 22 17:57:51 2016 From: michael at schmong.org (Michael Litchard) Date: Sun, 22 May 2016 10:57:51 -0700 Subject: [Haskell-cafe] Representation of 3-D objects in non-continuous space Message-ID: I've been poking at the problem that I've talked about in the following threads. https://groups.google.com/forum/#!searchin/haskell-cafe/michael$20litchard|sort:date/haskell-cafe/n0Tc29UUgoQ/iitt3z3PCwAJ https://groups.google.com/forum/#!searchin/haskell-cafe/michael$20litchard|sort:date/haskell-cafe/qD2kaZ9qpEA/jTDAp8KoCgAJ And my misguided conclusions here https://groups.google.com/forum/#!topic/haskell-cafe/PMtYhVQ5nNQ I'm trying to write a clone in haskell of the space-system implemented in http://swmud.org. The biggest error in my thinking so far is assuming I could do without spatial extent. Nope, these objects in space will have to have spatial extent. So no octree for me. The advice and comments from the first two threads prompted me to investigate R-trees. I could only find specifics about how to describe 2-D. Until I found this paper on layered R-Trees. http://www.isprs.org/proceedings/XXXIII/congress/part4/1216_XXXIII-part4.pdf This looks like what I want. Here's my re-formulation of the criteria: (1) Objects in space will be either ships that can move or stationary things like non-moving game-controlled ships, space-stations , moons and planets. (2) Objects will have spatial extent. Will use bounding volumes to help determine collisions. (3) Space is non-continuous (4) Movement happens by setting a destination vector and a speed. There's no steering exactly, but you can change destination while moving, slow down or stop suddenly. (5) Represent this space with a layered R-tree, This tree will at most have say, 200-300 objects in it, most of which could be moving around in this space. It's the number of objects that have me wondering if layered r-tree might be too heavy-weight. If so, Any links to R-tree variants that include bounding volumes? I could only find ones with bounding boxes. -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at schmong.org Sun May 22 18:08:20 2016 From: michael at schmong.org (Michael Litchard) Date: Sun, 22 May 2016 11:08:20 -0700 Subject: [Haskell-cafe] Representation of 3-D objects in non-continuous space In-Reply-To: References: Message-ID: I mean, I could only find ones with bounding rectangles. On Sun, May 22, 2016 at 10:57 AM, Michael Litchard wrote: > I've been poking at the problem that I've talked about in the following > threads. > > > https://groups.google.com/forum/#!searchin/haskell-cafe/michael$20litchard|sort:date/haskell-cafe/n0Tc29UUgoQ/iitt3z3PCwAJ > > > https://groups.google.com/forum/#!searchin/haskell-cafe/michael$20litchard|sort:date/haskell-cafe/qD2kaZ9qpEA/jTDAp8KoCgAJ > > And my misguided conclusions here > > https://groups.google.com/forum/#!topic/haskell-cafe/PMtYhVQ5nNQ > > I'm trying to write a clone in haskell of the space-system implemented in > http://swmud.org. > > The biggest error in my thinking so far is assuming I could do without > spatial extent. > Nope, these objects in space will have to have spatial extent. So no > octree for me. > The advice and comments from the first two threads prompted me to > investigate R-trees. > I could only find specifics about how to describe 2-D. > Until I found this paper on layered R-Trees. > > > http://www.isprs.org/proceedings/XXXIII/congress/part4/1216_XXXIII-part4.pdf > > This looks like what I want. Here's my re-formulation of the criteria: > > > (1) Objects in space will be either ships that can move or stationary > things like non-moving game-controlled ships, space-stations , moons and > planets. > > (2) Objects will have spatial extent. Will use bounding volumes to help > determine collisions. > > (3) Space is non-continuous > > (4) Movement happens by setting a destination vector and a speed. There's > no steering exactly, but you can change destination while moving, slow down > or stop suddenly. > > (5) Represent this space with a layered R-tree, This tree will at most > have say, 200-300 objects in it, most of which could be moving around in > this space. > > It's the number of objects that have me wondering if layered r-tree might > be too heavy-weight. > If so, Any links to R-tree variants that include bounding volumes? I could > only find ones with bounding boxes. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aovieth at gmail.com Sun May 22 18:12:40 2016 From: aovieth at gmail.com (Alexander Vieth) Date: Sun, 22 May 2016 14:12:40 -0400 Subject: [Haskell-cafe] Going insane over overlapping instances In-Reply-To: References: Message-ID: Hi Brian, You could eliminate the JSON constructor from your servant types by using it in the aeson instance for Foo itself: instance ToJSON Foo where toJSON = toJSON . JSON instance FromJSON Foo where parseJSON = fmap (\(JSON t) -> t) . parseJSON This way, JSON is used only where it's relevant: not in the servant types, but in the aeson instances. It gives the programmer a way to get them for HasStructParser types at pretty much no cost. I don't think duplicate instances are a concern here. If you want to use an existing aeson-equipped type in your servant routes, but redefine those aeson instance via HasStructParser, then make a newtype. In my opinion it's a good idea to have new types for servant inputs anyway, to make very clear the provenance of these values. Alex On Sun, May 22, 2016 at 1:05 PM, Brian Hurt wrote: > > This is driving me nuts. > > So I have a type class HasStructParser I've defined. Details are > irrelevant except that if you have HasStructParser defined, then ToJSON is > also defined. So I have: > instance HasStructParser s => ToJSON s where > ... > > But now, any type that defines ToJSON any other way causes an Overlapping > Instances error to happen- the conflict being between the real ToJSON > implementation and the one deriving from HasStructParser- this despite the > fact that there is no implementation for HasStructParser for the given type. > > Now, I don't want to allow Overlapping Instances because if there are > *real* overlapping instances, I want that to be an error. For instance, if > a structure did implement HasStructParser and some other implementation of > ToJSON, I want to know. > > I suppose I could go: > > newtype JSON a = JSON a > > instance HasStructParser s => ToJSON (JSON s) where ... > > But this strikes me as being ugly- now I have to add pointless JSON > constructors everywhere I want to convert to (or from) JSON. And this also > pollutes my type signatures all over the place- now I can't write a servant > endpoint type like: > :<|> "foo" :> "bar" :> Get '[JSON] [Foo] > I have to write: > :<|> "foo" :> "bar" :> Get '[JSON] [JSON Foo] > > And, of course, if I want to have multiple different types of outputs, now > we're off to the races. > > So my question is, is there a way to do this without throwing the baby out > with the bath water (turning on overloaded instances) or being seriously > ugly? Or am I just screwed? > > Brian > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin.jan.mrotek at gmail.com Sun May 22 18:22:27 2016 From: marcin.jan.mrotek at gmail.com (Marcin Mrotek) Date: Sun, 22 May 2016 20:22:27 +0200 Subject: [Haskell-cafe] TDNR without new operators or syntax changes In-Reply-To: References: Message-ID: This looks like a job for nested modules. Best regards, Marcin Mrotek -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.feuer at gmail.com Mon May 23 03:27:08 2016 From: david.feuer at gmail.com (David Feuer) Date: Sun, 22 May 2016 23:27:08 -0400 Subject: [Haskell-cafe] Help moving a bounds check into a case branch Message-ID: Sorry for the terrible subject line, but I'm a but stuck here. A couple days ago I overhauled Data.Sequence.splitAt, greatly improving its performance. You can see the new implementation at https://github.com/haskell/containers/blob/e8b1f664a631e3795dfd14f2d8c2b39c906284cf/Data/Sequence.hs#L2346 . There's one spot where I'm still stuck, however. Much like the original implementation, I check that the splitting index is before the end of the sequence (to ensure correctness). I go further, in fact, checking that the splitting index is positive, in order to avoid allocating a new tree-top in a trivial split. Logically, this check should be moved into the Deep case branch in splitTreeE, to avoid pattern matching on the top of the tree twice and performing redundant comparisons. However, when I make that move, the split/append benchmark gets worse. When I looked at the Core, it seemed that I confused GHC somehow. I ended up with a join point taking an extra argument that it totally ignored. I can fix that benchmark by marking the splitTreeMiddleE function INLINE, but then the zipWith benchmark went screwy. Unless I can get non-fragile results, I'm just going to accept the redundant case match. If anyone has any ideas, please let me know. Thanks, David Feuer From spam at scientician.net Mon May 23 15:21:29 2016 From: spam at scientician.net (Bardur Arantsson) Date: Mon, 23 May 2016 17:21:29 +0200 Subject: [Haskell-cafe] [ANNOUNCE] GHC 8.0.1 is available! In-Reply-To: <41BA6C56-793E-4862-A3C0-B2782A22622F@gmail.com> References: <8737pbxwvo.fsf@smart-cactus.org> <41BA6C56-793E-4862-A3C0-B2782A22622F@gmail.com> Message-ID: On 05/21/2016 05:39 PM, amindfv at gmail.com wrote: > Congratulations! Thank you everyone for all your hard work! > Seconded. Kudos to everyone who made this release happen! Regards, From spam at scientician.net Mon May 23 15:24:04 2016 From: spam at scientician.net (Bardur Arantsson) Date: Mon, 23 May 2016 17:24:04 +0200 Subject: [Haskell-cafe] Interacting with Java in GHCVM In-Reply-To: References: Message-ID: On 05/22/2016 10:16 AM, David Escobar wrote: > What about Frege? Haskell on the JVM with interop to Java libraries... > > https://github.com/Frege/frege > It doesn't support MPTCs, Type families, FunDeps, etc. etc. (I'm not trying to rag on the project. Supporting all of the now-almost-mandatory exensions in GHC is a highly non-trivial undertaking.) Regards, From dct25-561bs at mythic-beasts.com Tue May 24 08:10:46 2016 From: dct25-561bs at mythic-beasts.com (David Turner) Date: Tue, 24 May 2016 09:10:46 +0100 Subject: [Haskell-cafe] Stack build with GHC 8? Message-ID: Hi, My name appears in the Stackage GHC 8 mega-issue [ https://github.com/fpco/stackage/issues/1476] and I'd like to upgrade my packages. I suspect it's just a case of relaxing the upper bound on base to <4.10 but I'd quite like to check that this does, in fact, work. However I'm not sure how to go about doing this since there don't yet seem to be any stackage snapshots that use GHC 8. What's the best way to get around this? Cheers, David -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at snoyman.com Tue May 24 08:23:48 2016 From: michael at snoyman.com (Michael Snoyman) Date: Tue, 24 May 2016 11:23:48 +0300 Subject: [Haskell-cafe] Stack build with GHC 8? In-Reply-To: References: Message-ID: Having spent a lot of time doing just this today, you can use this incantation: stack init --resolver ghc-8.0.1 --force Run that from your project's directory. If you have upper bounds, it will complain about them. Once you relax them, it will generate an appropriate stack.yaml (overwriting any existing stack.yaml), at which point you can `stack test`. I've had a lot of success building packages today, it looks like people upgraded preemptively to GHC 8 this time :) On Tue, May 24, 2016 at 11:10 AM, David Turner < dct25-561bs at mythic-beasts.com> wrote: > Hi, > > My name appears in the Stackage GHC 8 mega-issue [ > https://github.com/fpco/stackage/issues/1476] and I'd like to upgrade my > packages. I suspect it's just a case of relaxing the upper bound on base to > <4.10 but I'd quite like to check that this does, in fact, work. > > However I'm not sure how to go about doing this since there don't yet seem > to be any stackage snapshots that use GHC 8. What's the best way to get > around this? > > Cheers, > > David > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aditya.siram at gmail.com Tue May 24 12:36:08 2016 From: aditya.siram at gmail.com (aditya siram) Date: Tue, 24 May 2016 07:36:08 -0500 Subject: [Haskell-cafe] GHC 8.0.1 Compile time regression + Trac ticket privileges Message-ID: [x-post from Reddit reply] Thanks so much for all the hard work! Unfortunately I have a compile time performance regression to report on my FLTKHS library. I also don't have a minimal example. There is a demo that took about 15 seconds compile and link in 7.10.3, but with no changes now takes over a minute in 8.0.1. I've reproduced this across machines and operating systems. Since there was interest expressed in using this example as a benchmark if any GHC devs are still willing to help, I'm willing to walk them through getting the library set up etc. It's not a long process. The tip of my Github branch has been updated to build with GHC 8.0.1. I made myself a Trac account but apparently I don't have Ticket privileges so it won't let me create one. My username is 'deech'. Thanks! -deech -------------- next part -------------- An HTML attachment was scrubbed... URL: From dons00 at gmail.com Tue May 24 16:12:35 2016 From: dons00 at gmail.com (Don Stewart) Date: Tue, 24 May 2016 16:12:35 +0000 Subject: [Haskell-cafe] Dev/tools/git/Haskell role in London Message-ID: https://donsbot.wordpress.com/2016/05/24/haskell-devtoolsgit-role-at-standard-chartered-london/ I have a new role at SCB this time in the "Modelling Infrastructure" team to work on our Haskell-based continuous integration and testing system on top of git. This is a London role. More details in the linked post. -------------- next part -------------- An HTML attachment was scrubbed... URL: From erik.dominikus71 at gmail.com Tue May 24 17:43:51 2016 From: erik.dominikus71 at gmail.com (Erik Dominikus) Date: Wed, 25 May 2016 00:43:51 +0700 Subject: [Haskell-cafe] A Java bytecode interpreter written in Haskell Message-ID: (Please keep expectations low for now; this is just a weekend project.) I have written, in Haskell, something that aspires to be a Java Virtual Machine (but I don't call it a JVM yet as it doesn't fully comply with the spec). The code is available here: https://github.com/edom/haji This is similar to Frege [3], but while Frege aims to run a variant of Haskell on Java, this project tries the other direction: running a subset of Java on Haskell. Thanks. Best, Erik Some related stuffs: [1] https://github.com/MateVM/MateVM [2] https://hackage.haskell.org/package/hs-java [3] https://github.com/Frege/frege [4] https://wiki.haskell.org/GHC:FAQ#Why_isn.27t_GHC_available_for_.NET_or_on_the_JVM.3F [5] https://github.com/levans/Open-Quark From simon at joyful.com Tue May 24 18:17:51 2016 From: simon at joyful.com (Simon Michael) Date: Tue, 24 May 2016 11:17:51 -0700 Subject: [Haskell-cafe] ANN: reviving #haskell-ide channel In-Reply-To: <5dd94717-891c-ec93-65a2-00d7e7875e57@joyful.com> References: <5dd94717-891c-ec93-65a2-00d7e7875e57@joyful.com> Message-ID: Recently I announced a #haskell-atom IRC channel. It has been very quiet. Also today I'm having better success with Intellij IDEA. These things change.. Perhaps a channel for all IDEs & dev setups is more useful. #haskell-ide already exists, so I have added some links there and plan to hang out for a while and see if it catches on. All welcome! /topic for #haskell-ide: "tips and support for all Haskell IDEs and development tools | https://wiki.haskell.org/IDEs | https://www.reddit.com/r/haskell/comments/4k77yt/haskell_stack_and_intellij_idea_ide_setup | https://github.com/simonmichael/haskell-atom-setup | http://haskell.github.io/haskell-mode | https://github.com/begriffs/haskell-vim-now | http://eclipsefp.github.io | http://leksah.org" -Simon On 5/16/16 2:26 PM, Simon Michael wrote: > Hi all, > > Recently I helped a newcomer set up Haskell and Atom (the text > editor/IDE - not the embedded systems DSL), and also for the first time > succeeded in getting a "modern IDE experience" working with my own > projects. I've saved my notes so far - I hope you'll also find them useful: > > https://github.com/simonmichael/haskell-atom-setup > > In the process I found some issues, looked for help in many places, and > wished the #haskell-atom IRC channel existed. So I've started it: > > #haskell-atom on Freenode > > I'm an Emacs man, but I try all the available Haskell IDEs periodically. > Atom is the first one where I've succeeded in getting inline error > reporting working, and it's the only one I could recommend to a new > programmer or a mainstream IDE lover right now. So I think this channel > is worth having, and will grow. All welcome! > > Best, > -Simon From publicityifl at gmail.com Tue May 24 19:13:56 2016 From: publicityifl at gmail.com (publicityifl at gmail.com) Date: Tue, 24 May 2016 19:13:56 +0000 Subject: [Haskell-cafe] 1st CfP: IFL 2016 (28th Symposium on Implementation and Application of Functional Languages) Message-ID: <001a11407234c6ff4805339b5bcd@google.com> Hello, Please, find below the first call for papers for IFL 2016. Please forward these to anyone you think may be interested. Apologies for any duplicates you may receive. best regards, Jurriaan Hage Publicity Chair of IFL --- IFL 2016 - Call for papers 28th SYMPOSIUM ON IMPLEMENTATION AND APPLICATION OF FUNCTIONAL LANGUAGES - IFL 2016 KU Leuven, Belgium In cooperation with ACM SIGPLAN August 31 - September 2, 2016 https://dtai.cs.kuleuven.be/events/ifl2016/ Scope The goal of the IFL symposia is to bring together researchers actively engaged in the implementation and application of functional and function-based programming languages. IFL 2016 will be a venue for researchers to present and discuss new ideas and concepts, work in progress, and publication-ripe results related to the implementation and application of functional languages and function-based programming. Peer-review Following the IFL tradition, IFL 2016 will use a post-symposium review process to produce the formal proceedings. All participants of IFL 2016 are invited to submit either a draft paper or an extended abstract describing work to be presented at the symposium. At no time may work submitted to IFL be simultaneously submitted to other venues; submissions must adhere to ACM SIGPLAN's republication policy: http://www.sigplan.org/Resources/Policies/Republication The submissions will be screened by the program committee chair to make sure they are within the scope of IFL, and will appear in the draft proceedings distributed at the symposium. Submissions appearing in the draft proceedings are not peer-reviewed publications. Hence, publications that appear only in the draft proceedings are not subject to the ACM SIGPLAN republication policy. After the symposium, authors will be given the opportunity to incorporate the feedback from discussions at the symposium and will be invited to submit a revised full article for the formal review process. From the revised submissions, the program committee will select papers for the formal proceedings considering their correctness, novelty, originality, relevance, significance, and clarity. The formal proceedings will appear in the International Conference Proceedings Series of the ACM Digital Library. Important dates August 1: Submission deadline draft papers August 3: Notification of acceptance for presentation August 5: Early registration deadline August 12: Late registration deadline August 22: Submission deadline for pre-symposium proceedings August 31 - September 2: IFL Symposium December 1: Submission deadline for post-symposium proceedings January 31, 2017: Notification of acceptance for post-symposium proceedings March 15, 2017: Camera-ready version for post-symposium proceedings Submission details Prospective authors are encouraged to submit papers or extended abstracts to be published in the draft proceedings and to present them at the symposium. All contributions must be written in English. Papers must use the new ACM two columns conference format, which can be found at: http://www.acm.org/publications/proceedings-template For the pre-symposium proceedings we adopt a 'weak' page limit of 12 pages. For the post-symposium proceedings the page limit of 12 pages is firm. Authors submit through EasyChair: https://easychair.org/conferences/?conf=ifl2016 Topics IFL welcomes submissions describing practical and theoretical work as well as submissions describing applications and tools in the context of functional programming. If you are not sure whether your work is appropriate for IFL 2016, please contact the PC chair at tom.schrijvers at cs.kuleuven.be. Topics of interest include, but are not limited to: - language concepts - type systems, type checking, type inferencing - compilation techniques - staged compilation - run-time function specialization - run-time code generation - partial evaluation - (abstract) interpretation - metaprogramming - generic programming - automatic program generation - array processing - concurrent/parallel programming - concurrent/parallel program execution - embedded systems - web applications - (embedded) domain specific languages - security - novel memory management techniques - run-time profiling performance measurements - debugging and tracing - virtual/abstract machine architectures - validation, verification of functional programs - tools and programming techniques - (industrial) applications Peter Landin Prize The Peter Landin Prize is awarded to the best paper presented at the symposium every year. The honored article is selected by the program committee based on the submissions received for the formal review process. The prize carries a cash award equivalent to 150 Euros. Programme committee Chair: Tom Schrijvers, KU Leuven, Belgium - Sandrine Blazy, University of Rennes 1, France - Laura Castro, University of A Coru??a, Spain - Jacques, Garrigue, Nagoya University, Japan - Clemens Grelck, University of Amsterdam, The Netherlands - Zoltan Horvath, Eotvos Lorand University, Hungary - Jan Martin Jansen, Netherlands Defence Academy, The Netherlands - Mauro Jaskelioff, CIFASIS/Universidad Nacional de Rosario, Argentina - Patricia Johann, Appalachian State University, USA - Wolfram Kahl, McMaster University, Canada - Pieter Koopman, Radboud University Nijmegen, The Netherlands - Shin-Cheng Mu, Academia Sinica, Taiwan - Henrik Nilsson, University of Nottingham, UK - Nikolaos Papaspyrou, National Technical University of Athens, Greece - Atze van der Ploeg, Chalmers University of Technology, Sweden - Matija Pretnar, University of Ljubljana, Slovenia - Tillmann Rendel, University of T??bingen, Germany - Christophe Scholliers, Universiteit Gent, Belgium - Sven-Bodo Scholz, Heriot-Watt University, UK - Melinda Toth, Eotvos Lorand University, Hungary - Meng Wang, University of Kent, UK - Jeremy Yallop, University of Cambridge, UK Venue The 28th IFL will be held in association with the Faculty of Computer Science, KU Leuven, Belgium. Leuven is centrally located in Belgium and can be easily reached from Brussels Airport by train (~15 minutes). The venue in the Arenberg Castle park can be reached by foot, bus or taxi from the city center. See the website for more information on the venue. -------------- next part -------------- An HTML attachment was scrubbed... URL: From i.caught.air at gmail.com Tue May 24 22:08:30 2016 From: i.caught.air at gmail.com (Alex Belanger) Date: Tue, 24 May 2016 18:08:30 -0400 Subject: [Haskell-cafe] ANN: reviving #haskell-ide channel In-Reply-To: References: <5dd94717-891c-ec93-65a2-00d7e7875e57@joyful.com> Message-ID: If that kind of thing were to be extra common in #haskell to the point of spawning unterminably long discussions and create a lot of noise (which is still arguably good noise) then maybe an extra channel could make sense. Personally, the cause is good, the mean is questionable. Obviously I wish you a great success and would love to be proved wrong. Cheers, nitrix On May 24, 2016 2:17 PM, "Simon Michael" wrote: > Recently I announced a #haskell-atom IRC channel. It has been very quiet. > Also today I'm having better success with Intellij IDEA. These things > change.. > > Perhaps a channel for all IDEs & dev setups is more useful. #haskell-ide > already exists, so I have added some links there and plan to hang out for a > while and see if it catches on. All welcome! > > /topic for #haskell-ide: > "tips and support for all Haskell IDEs and development tools | > https://wiki.haskell.org/IDEs | > > https://www.reddit.com/r/haskell/comments/4k77yt/haskell_stack_and_intellij_idea_ide_setup > | > https://github.com/simonmichael/haskell-atom-setup | > http://haskell.github.io/haskell-mode | > https://github.com/begriffs/haskell-vim-now | > http://eclipsefp.github.io | > http://leksah.org" > > -Simon > > > On 5/16/16 2:26 PM, Simon Michael wrote: > >> Hi all, >> >> Recently I helped a newcomer set up Haskell and Atom (the text >> editor/IDE - not the embedded systems DSL), and also for the first time >> succeeded in getting a "modern IDE experience" working with my own >> projects. I've saved my notes so far - I hope you'll also find them >> useful: >> >> https://github.com/simonmichael/haskell-atom-setup >> >> In the process I found some issues, looked for help in many places, and >> wished the #haskell-atom IRC channel existed. So I've started it: >> >> #haskell-atom on Freenode >> >> I'm an Emacs man, but I try all the available Haskell IDEs periodically. >> Atom is the first one where I've succeeded in getting inline error >> reporting working, and it's the only one I could recommend to a new >> programmer or a mainstream IDE lover right now. So I think this channel >> is worth having, and will grow. All welcome! >> >> Best, >> -Simon >> > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rahulmutt at gmail.com Wed May 25 04:20:22 2016 From: rahulmutt at gmail.com (Rahul Muttineni) Date: Wed, 25 May 2016 09:50:22 +0530 Subject: [Haskell-cafe] Interacting with Java in GHCVM In-Reply-To: References: Message-ID: Hi Alp, I had a nice time going through inline-java and sparkle! The API I made up for the Java FFI is similar to yours but I don't do the extensive type-level hackery that you have. Another key difference is that I use GHC Annotations to specify the qualified class name where you use type-level strings. Nice work supporting almost all of the JNI in a clean way! I recently looked at the JNI API and it stated that the functions that interact with the JVM are a tad slow due to reflection + the fact that native methods don't get inlined. I'm interested in benchmarking programs compiled with GHC/Sparkle vs GHCVM/FFI to Spark once the first release is out. Thanks, Rahul On Sun, May 22, 2016 at 1:05 PM, Alp Mestanogullari wrote: > Hi, > > For what it's worth, at Tweag we've developed some preliminary bindings to > Apache Spark, and as part of this we developed a somewhat decent API for > calling Java. You can check it out on hackage [1] and on github [2]. In > cast that can save you some time or inspire you. > > [1]: http://hackage.haskell.org/package/inline-java > [2]: https://github.com/tweag/sparkle -- see the inline-java directory > > > On Sun, May 22, 2016 at 4:54 AM, Rahul Muttineni > wrote: > >> Hi Haskell-Cafe, >> >> I've been working on a JVM backend for GHC [1] and I took some time to >> flesh out a design for the Java FFI [2] which will pretty much decide >> whether the project will be useful or not. I would love feedback from the >> community on how to improve the design or requests for important interop >> features that I have neglected. >> >> Thanks, >> Rahul Muttineni >> >> [1] http://github.com/rahulmutt/ghcvm >> [2] https://gist.github.com/rahulmutt/355505bce57c7c2cffd7d4cf5edddad4 >> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >> >> > > > -- > Alp Mestanogullari > -- Rahul Muttineni -------------- next part -------------- An HTML attachment was scrubbed... URL: From monkleyon at googlemail.com Wed May 25 04:23:26 2016 From: monkleyon at googlemail.com (martin) Date: Wed, 25 May 2016 06:23:26 +0200 Subject: [Haskell-cafe] A Java bytecode interpreter written in Haskell In-Reply-To: References: Message-ID: <574528BE.90005@gmail.com> > I have written, in Haskell, something that aspires to be a Java > Virtual Machine That sounds interesting... Just to be sure: I suppose it executes the code "live" just like a "real" JVM? Or do you compile Bytecode to Haskell - which would mean you found a way to sidestep a lot of the issues the authors of the [MateVM](https://github.com/MateVM/MateVM) must have run into? Also, do you have any concrete plans what you want to use it for when it's ready or was that just a really involved and commendable exercise? Cheers, Martin From rahulmutt at gmail.com Wed May 25 04:56:20 2016 From: rahulmutt at gmail.com (Rahul Muttineni) Date: Wed, 25 May 2016 10:26:20 +0530 Subject: [Haskell-cafe] Interacting with Java in GHCVM In-Reply-To: References: Message-ID: Hi David, You can find the differences between GHCVM and Frege here: https://github.com/rahulmutt/ghcvm/issues/3 The primary difference is that since we're using the GHC API, you'll have the access to all the features of GHC Haskell (barring Template Haskell which requires more effort). Also, the interaction with Java is very different, see here: https://gist.github.com/rahulmutt/355505bce57c7c2cffd7d4cf5edddad4 Thanks, Rahul On Sun, May 22, 2016 at 1:46 PM, David Escobar wrote: > What about Frege? Haskell on the JVM with interop to Java libraries... > > https://github.com/Frege/frege > > > On Sat, May 21, 2016 at 7:54 PM, Rahul Muttineni > wrote: > >> Hi Haskell-Cafe, >> >> I've been working on a JVM backend for GHC [1] and I took some time to >> flesh out a design for the Java FFI [2] which will pretty much decide >> whether the project will be useful or not. I would love feedback from the >> community on how to improve the design or requests for important interop >> features that I have neglected. >> >> Thanks, >> Rahul Muttineni >> >> [1] http://github.com/rahulmutt/ghcvm >> [2] https://gist.github.com/rahulmutt/355505bce57c7c2cffd7d4cf5edddad4 >> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >> >> > -- Rahul Muttineni -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidescobar at ieee.org Wed May 25 07:09:41 2016 From: davidescobar at ieee.org (David Escobar) Date: Wed, 25 May 2016 00:09:41 -0700 Subject: [Haskell-cafe] Interacting with Java in GHCVM In-Reply-To: References: Message-ID: Thank you for the information Rahul. This makes it clear. On Tue, May 24, 2016 at 9:56 PM, Rahul Muttineni wrote: > Hi David, > > You can find the differences between GHCVM and Frege here: > https://github.com/rahulmutt/ghcvm/issues/3 > > The primary difference is that since we're using the GHC API, you'll have > the access to all the features of GHC Haskell (barring Template Haskell > which requires more effort). > > Also, the interaction with Java is very different, see here: > https://gist.github.com/rahulmutt/355505bce57c7c2cffd7d4cf5edddad4 > > Thanks, > Rahul > > On Sun, May 22, 2016 at 1:46 PM, David Escobar > wrote: > >> What about Frege? Haskell on the JVM with interop to Java libraries... >> >> https://github.com/Frege/frege >> >> >> On Sat, May 21, 2016 at 7:54 PM, Rahul Muttineni >> wrote: >> >>> Hi Haskell-Cafe, >>> >>> I've been working on a JVM backend for GHC [1] and I took some time to >>> flesh out a design for the Java FFI [2] which will pretty much decide >>> whether the project will be useful or not. I would love feedback from the >>> community on how to improve the design or requests for important interop >>> features that I have neglected. >>> >>> Thanks, >>> Rahul Muttineni >>> >>> [1] http://github.com/rahulmutt/ghcvm >>> [2] https://gist.github.com/rahulmutt/355505bce57c7c2cffd7d4cf5edddad4 >>> >>> >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >>> >>> >> > > > -- > Rahul Muttineni > -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidescobar at ieee.org Wed May 25 07:13:23 2016 From: davidescobar at ieee.org (David Escobar) Date: Wed, 25 May 2016 00:13:23 -0700 Subject: [Haskell-cafe] Interacting with Java in GHCVM In-Reply-To: References: Message-ID: Makes sense. I hadn't thought about all the GHC extensions. On Mon, May 23, 2016 at 8:24 AM, Bardur Arantsson wrote: > On 05/22/2016 10:16 AM, David Escobar wrote: > > What about Frege? Haskell on the JVM with interop to Java libraries... > > > > https://github.com/Frege/frege > > > > It doesn't support MPTCs, Type families, FunDeps, etc. etc. > > (I'm not trying to rag on the project. Supporting all of the > now-almost-mandatory exensions in GHC is a highly non-trivial undertaking.) > > Regards, > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From asviraspossible at gmail.com Wed May 25 08:25:34 2016 From: asviraspossible at gmail.com (Victor Nazarov) Date: Wed, 25 May 2016 11:25:34 +0300 Subject: [Haskell-cafe] A Java bytecode interpreter written in Haskell In-Reply-To: References: Message-ID: On Tue, May 24, 2016 at 8:43 PM, Erik Dominikus wrote: > (Please keep expectations low for now; this is just a weekend project.) > > I have written, in Haskell, something that aspires to be a Java > Virtual Machine (but I don't call it a JVM yet as it doesn't fully > comply with the spec). The code is available here: > > https://github.com/edom/haji > > This is similar to Frege [3], but while Frege aims to run a variant of > Haskell on Java, this project tries the other direction: running a > subset of Java on Haskell. > > I think it can be really interesting for Java community if you implement Java-runtime directly the same way GHC-runtime is implemented, i.e. Java-threads as GHC's IO-threads (i. e. green threads) and Java-I/O as GHC's input-output (which is asynchronous internally to support green-threading model). -- Victor Nazarov > > Some related stuffs: > > [1] https://github.com/MateVM/MateVM > [2] https://hackage.haskell.org/package/hs-java > [3] https://github.com/Frege/frege > [4] > https://wiki.haskell.org/GHC:FAQ#Why_isn.27t_GHC_available_for_.NET_or_on_the_JVM.3F > [5] https://github.com/levans/Open-Quark > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palotai.robin at gmail.com Wed May 25 16:41:58 2016 From: palotai.robin at gmail.com (Robin Palotai) Date: Wed, 25 May 2016 16:41:58 +0000 Subject: [Haskell-cafe] Example of FunBind without wrapping AbsBind? Message-ID: I was playing with the AST's typechecked tree, and found some examples of the subject, but can't tell what is the rule for that to occur. It was a local binding. Do you have a hint and/or a minimal example? Thanks! Robin -------------- next part -------------- An HTML attachment was scrubbed... URL: From erik.dominikus71 at gmail.com Wed May 25 17:21:54 2016 From: erik.dominikus71 at gmail.com (Erik Dominikus) Date: Thu, 26 May 2016 00:21:54 +0700 Subject: [Haskell-cafe] A Java bytecode interpreter written in Haskell In-Reply-To: References: Message-ID: @Martin Yes, it does it "live". No compilation, just interpretation. Honestly, there was no strong reason for me to make a JVM, and I don't have a plan. I just needed some ego boost over my fellow programmers. So yes, it was just an involved and commendable exercise. You saw through me... LOL... (But it's licensed under BSD3 in case someone finds something interesting to do.) @Victor Interesting idea. Yes, in principle we could implement a JVM where all java.lang.Thread instances are green threads, and all IO operations are nonblocking, just like GHC runtime, and this will allow Java programmers to write code in the easiest way (just new Thread() everywhere) without performance penalty. On Wed, May 25, 2016 at 3:25 PM, Victor Nazarov wrote: > On Tue, May 24, 2016 at 8:43 PM, Erik Dominikus > wrote: >> >> (Please keep expectations low for now; this is just a weekend project.) >> >> I have written, in Haskell, something that aspires to be a Java >> Virtual Machine (but I don't call it a JVM yet as it doesn't fully >> comply with the spec). The code is available here: >> >> https://github.com/edom/haji >> >> This is similar to Frege [3], but while Frege aims to run a variant of >> Haskell on Java, this project tries the other direction: running a >> subset of Java on Haskell. >> > > I think it can be really interesting for Java community if you implement > Java-runtime directly the same way GHC-runtime is implemented, i.e. > Java-threads as GHC's IO-threads (i. e. green threads) and Java-I/O as GHC's > input-output (which is asynchronous internally to support green-threading > model). > > -- > Victor Nazarov >> >> >> Some related stuffs: >> >> [1] https://github.com/MateVM/MateVM >> [2] https://hackage.haskell.org/package/hs-java >> [3] https://github.com/Frege/frege >> [4] >> https://wiki.haskell.org/GHC:FAQ#Why_isn.27t_GHC_available_for_.NET_or_on_the_JVM.3F >> [5] https://github.com/levans/Open-Quark >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > From alpmestan at gmail.com Wed May 25 22:14:05 2016 From: alpmestan at gmail.com (Alp Mestanogullari) Date: Thu, 26 May 2016 00:14:05 +0200 Subject: [Haskell-cafe] Interacting with Java in GHCVM In-Reply-To: References: Message-ID: Hey Rahul, Please keep us posted about further experiments/benchmarks, I'm really interested in seeing where GHCVM goes and what we can learn/reuse from it :) Cheers On Wed, May 25, 2016 at 6:20 AM, Rahul Muttineni wrote: > Hi Alp, > > I had a nice time going through inline-java and sparkle! The API I made up > for the Java FFI is similar to yours but I don't do the extensive > type-level hackery that you have. Another key difference is that I use GHC > Annotations to specify the qualified class name where you use type-level > strings. > > Nice work supporting almost all of the JNI in a clean way! I recently > looked at the JNI API and it stated that the functions that interact with > the JVM are a tad slow due to reflection + the fact that native methods > don't get inlined. I'm interested in benchmarking programs compiled with > GHC/Sparkle vs GHCVM/FFI to Spark once the first release is out. > > Thanks, > Rahul > > > On Sun, May 22, 2016 at 1:05 PM, Alp Mestanogullari > wrote: > >> Hi, >> >> For what it's worth, at Tweag we've developed some preliminary bindings >> to Apache Spark, and as part of this we developed a somewhat decent API for >> calling Java. You can check it out on hackage [1] and on github [2]. In >> cast that can save you some time or inspire you. >> >> [1]: http://hackage.haskell.org/package/inline-java >> [2]: https://github.com/tweag/sparkle -- see the inline-java directory >> >> >> On Sun, May 22, 2016 at 4:54 AM, Rahul Muttineni >> wrote: >> >>> Hi Haskell-Cafe, >>> >>> I've been working on a JVM backend for GHC [1] and I took some time to >>> flesh out a design for the Java FFI [2] which will pretty much decide >>> whether the project will be useful or not. I would love feedback from the >>> community on how to improve the design or requests for important interop >>> features that I have neglected. >>> >>> Thanks, >>> Rahul Muttineni >>> >>> [1] http://github.com/rahulmutt/ghcvm >>> [2] https://gist.github.com/rahulmutt/355505bce57c7c2cffd7d4cf5edddad4 >>> >>> >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >>> >>> >> >> >> -- >> Alp Mestanogullari >> > > > > -- > Rahul Muttineni > -- Alp Mestanogullari -------------- next part -------------- An HTML attachment was scrubbed... URL: From asviraspossible at gmail.com Thu May 26 11:05:37 2016 From: asviraspossible at gmail.com (Victor Nazarov) Date: Thu, 26 May 2016 14:05:37 +0300 Subject: [Haskell-cafe] A Java bytecode interpreter written in Haskell In-Reply-To: References: Message-ID: On Wed, May 25, 2016 at 8:21 PM, Erik Dominikus wrote: > @Victor > > Interesting idea. Yes, in principle we could implement a JVM where all > java.lang.Thread instances are green threads, and all IO operations > are nonblocking, just like GHC runtime, and this will allow Java > programmers to write code in the easiest way (just new Thread() > everywhere) without performance penalty. > > Exactly. I don't know if it is really feasible, though. There is already Quasar[1] project for Java, but it has it's limits since it work by bytecode preprocessing. Streaght forward JVM with green threads should be cool. [1] http://www.paralleluniverse.co/quasar/ -- Victor Nazarov > On Wed, May 25, 2016 at 3:25 PM, Victor Nazarov > wrote: > > On Tue, May 24, 2016 at 8:43 PM, Erik Dominikus < > erik.dominikus71 at gmail.com> > > wrote: > >> > >> (Please keep expectations low for now; this is just a weekend project.) > >> > >> I have written, in Haskell, something that aspires to be a Java > >> Virtual Machine (but I don't call it a JVM yet as it doesn't fully > >> comply with the spec). The code is available here: > >> > >> https://github.com/edom/haji > >> > >> This is similar to Frege [3], but while Frege aims to run a variant of > >> Haskell on Java, this project tries the other direction: running a > >> subset of Java on Haskell. > >> > > > > I think it can be really interesting for Java community if you implement > > Java-runtime directly the same way GHC-runtime is implemented, i.e. > > Java-threads as GHC's IO-threads (i. e. green threads) and Java-I/O as > GHC's > > input-output (which is asynchronous internally to support green-threading > > model). > > > > -- > > Victor Nazarov > >> > >> > >> Some related stuffs: > >> > >> [1] https://github.com/MateVM/MateVM > >> [2] https://hackage.haskell.org/package/hs-java > >> [3] https://github.com/Frege/frege > >> [4] > >> > https://wiki.haskell.org/GHC:FAQ#Why_isn.27t_GHC_available_for_.NET_or_on_the_JVM.3F > >> [5] https://github.com/levans/Open-Quark > >> _______________________________________________ > >> Haskell-Cafe mailing list > >> Haskell-Cafe at haskell.org > >> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aditya.siram at gmail.com Thu May 26 17:37:34 2016 From: aditya.siram at gmail.com (aditya siram) Date: Thu, 26 May 2016 12:37:34 -0500 Subject: [Haskell-cafe] GHC 8.0.1 Compile time regression + Trac ticket privileges In-Reply-To: References: Message-ID: Did I post this to the wrong list? On Tue, May 24, 2016 at 7:36 AM, aditya siram wrote: > [x-post from Reddit reply] > > Thanks so much for all the hard work! > > Unfortunately I have a compile time performance regression to report on my > FLTKHS library. I also don't have a > minimal example. There is a demo that took about 15 seconds compile and > link in 7.10.3, but with no changes now takes over a minute in 8.0.1. I've > reproduced this across machines and operating systems. > > Since there was interest expressed in using this example as a benchmark if > any GHC devs are still willing to help, I'm willing to walk them through > getting the library set up etc. It's not a long process. The tip of my > Github branch has been updated to build with GHC 8.0.1. > I made myself a Trac account but apparently I don't have Ticket privileges > so it won't let me create one. My username is 'deech'. > > Thanks! > -deech > -------------- next part -------------- An HTML attachment was scrubbed... URL: From michaelburge at pobox.com Thu May 26 18:17:37 2016 From: michaelburge at pobox.com (Michael Burge) Date: Thu, 26 May 2016 11:17:37 -0700 Subject: [Haskell-cafe] GHC 8.0.1 Compile time regression + Trac ticket privileges In-Reply-To: References: Message-ID: Hello Aditya, There is a 'ghc-devs at haskell.org' mailing list that might be better for this question. I'm sure they'd be interested if you gave them a concrete test case for this. On Thu, May 26, 2016 at 10:37 AM, aditya siram wrote: > Did I post this to the wrong list? > > On Tue, May 24, 2016 at 7:36 AM, aditya siram > wrote: > >> [x-post from Reddit reply] >> >> Thanks so much for all the hard work! >> >> Unfortunately I have a compile time performance regression to report on >> my FLTKHS library. I also don't have a >> minimal example. There is a demo that took about 15 seconds compile and >> link in 7.10.3, but with no changes now takes over a minute in 8.0.1. I've >> reproduced this across machines and operating systems. >> >> Since there was interest expressed in using this example as a benchmark >> if any GHC devs are still willing to help, I'm willing to walk them through >> getting the library set up etc. It's not a long process. The tip of my >> Github branch has been updated to build with GHC 8.0.1. >> I made myself a Trac account but apparently I don't have Ticket >> privileges so it won't let me create one. My username is 'deech'. >> >> Thanks! >> -deech >> > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From erantapaa at gmail.com Fri May 27 00:36:49 2016 From: erantapaa at gmail.com (Erik Rantapaa) Date: Thu, 26 May 2016 17:36:49 -0700 (PDT) Subject: [Haskell-cafe] Haskell newb trying to write a basic program. In-Reply-To: References: Message-ID: Have a look at the HaskellForMaths package. Using the Math.Algebra.Group.PermutationGroup module the expression `elts (_A n)` will return all the permutations of A_n. On Thursday, May 26, 2016 at 6:39:52 PM UTC-5, Blake Sims wrote: > > Hi, > > I am a newb to Haskell and programming in general, but I was trying to > write a basic program to find the elements for the alternating group for > any n. > > For the symmetric group I wrote something like this > > input Data.List > > symmetric n = permutations ([1..n]) > > What if I just want to find the even permutations? What is the quick and > dirty way of doing this? I was looking at the package Data.Matrix and > messing around with permutation matrices, but there has got to be a quicker > and easier way of doing it. I am skimming the book learn you a Haskell, but > my attention span is pretty short so if someone could direct me in the > right direction I'd be much obliged. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From spam at scientician.net Fri May 27 04:40:35 2016 From: spam at scientician.net (Bardur Arantsson) Date: Fri, 27 May 2016 06:40:35 +0200 Subject: [Haskell-cafe] Hackage (partially) down? Message-ID: Hi all, I'm getting Error 503 Connection timed out Connection timed out Guru Mediation: Details: cache-ams4123-AMS 1464323906 827600523 Varnish cache server when trying to browse Hackage this morning. Anyone else having the same problem? (downforeveryoneorjustme.com says that "it's just me", so I'm guessing this is some sort of CDN issue?) Regards, From mgsloan at gmail.com Fri May 27 04:46:11 2016 From: mgsloan at gmail.com (Michael Sloan) Date: Thu, 26 May 2016 21:46:11 -0700 Subject: [Haskell-cafe] Hackage (partially) down? In-Reply-To: References: Message-ID: It is not just you, see also https://github.com/haskell/hackage-server/issues/500 (amazingly apt issue number there) https://www.reddit.com/r/haskell/comments/4l8wi6/hackage_downtime/ Rather untimely hackage downtime for me, I was about to update amend the store package metadata with more version constraints. -Michael On Thu, May 26, 2016 at 9:40 PM, Bardur Arantsson wrote: > Hi all, > > I'm getting > > Error 503 Connection timed out > Connection timed out > Guru Mediation: > Details: cache-ams4123-AMS 1464323906 827600523 > Varnish cache server > > when trying to browse Hackage this morning. Anyone else having the same > problem? > > (downforeveryoneorjustme.com says that "it's just me", so I'm guessing > this is some sort of CDN issue?) > > Regards, > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidescobar1976 at gmail.com Fri May 27 04:50:07 2016 From: davidescobar1976 at gmail.com (David Escobar) Date: Thu, 26 May 2016 21:50:07 -0700 Subject: [Haskell-cafe] Hackage (partially) down? In-Reply-To: References: Message-ID: I just tried it and it's down for me as well. Over the last few months, I've noticed that Hackage goes down like that periodically - not sure why. Usually it only lasts for a few hours, but it's a problem when you're in the middle of something important. On May 26, 2016 9:40 PM, "Bardur Arantsson" wrote: > Hi all, > > I'm getting > > Error 503 Connection timed out > Connection timed out > Guru Mediation: > Details: cache-ams4123-AMS 1464323906 827600523 > Varnish cache server > > when trying to browse Hackage this morning. Anyone else having the same > problem? > > (downforeveryoneorjustme.com says that "it's just me", so I'm guessing > this is some sort of CDN issue?) > > Regards, > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at snoyman.com Fri May 27 04:55:57 2016 From: michael at snoyman.com (Michael Snoyman) Date: Fri, 27 May 2016 04:55:57 +0000 Subject: [Haskell-cafe] Hackage (partially) down? In-Reply-To: References: Message-ID: It doesn't solve the problem of uploads, but for doing dev you can switch to the FP Complete mirror, powered by Amazon S3 https://www.fpcomplete.com/blog/2015/03/hackage-mirror Stack uses it (plus the all-cabal-hashes Git repository) by default. On Fri, May 27, 2016, 7:50 AM David Escobar wrote: > I just tried it and it's down for me as well. Over the last few months, > I've noticed that Hackage goes down like that periodically - not sure why. > Usually it only lasts for a few hours, but it's a problem when you're in > the middle of something important. > On May 26, 2016 9:40 PM, "Bardur Arantsson" wrote: > >> Hi all, >> >> I'm getting >> >> Error 503 Connection timed out >> Connection timed out >> Guru Mediation: >> Details: cache-ams4123-AMS 1464323906 827600523 >> Varnish cache server >> >> when trying to browse Hackage this morning. Anyone else having the same >> problem? >> >> (downforeveryoneorjustme.com says that "it's just me", so I'm guessing >> this is some sort of CDN issue?) >> >> Regards, >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >> > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From justin.k.wood at gmail.com Fri May 27 12:42:37 2016 From: justin.k.wood at gmail.com (Justin Wood) Date: Fri, 27 May 2016 08:42:37 -0400 Subject: [Haskell-cafe] Mobile Development Message-ID: I'm wondering if anyone has any experience they can share, know of any blog posts or anything else documenting the use of Haskell when developing a mobile application. Ideally, I would like something along the lines of having a native UI, a language bridge, and use Haskell for the core logic. My main focus would be getting this to work on Android and iOS. If this would also work on Blackberry and Windows Phone it would be a plus. I have successfully done this using C++ in place of Haskell in the past, but would really be interested in getting something working using Haskell. Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: From chneukirchen at gmail.com Fri May 27 13:05:51 2016 From: chneukirchen at gmail.com (Christian Neukirchen) Date: Fri, 27 May 2016 15:05:51 +0200 Subject: [Haskell-cafe] Munich Haskell Meeting, 2016-05-30 @ 19:30 Max Emanuel Brauerei Message-ID: <8760tzwt00.fsf@gmail.com> Dear all, Next week, our monthly Munich Haskell Meeting will take place again on Monday, May 30 at *Max Emanuel Brauerei* at 19h30. For details see here: http://chneukirchen.github.io/haskell-munich.de/dates.html **Please note the changed location!** If you plan to join, please add yourself *quickly* to this dudle so we can reserve enough seats! It is OK to add yourself to the dudle anonymously or pseudonymously. https://dudle.inf.tu-dresden.de/haskell-munich-may-2016/ Everybody is welcome! cu, -- Christian Neukirchen http://chneukirchen.org From targen at gmail.com Fri May 27 16:31:12 2016 From: targen at gmail.com (=?UTF-8?Q?Manuel_G=C3=B3mez?=) Date: Fri, 27 May 2016 12:31:12 -0400 Subject: [Haskell-cafe] Mobile Development In-Reply-To: References: Message-ID: On Fri, May 27, 2016 at 8:42 AM, Justin Wood wrote: > I'm wondering if anyone has any experience they can share, know of any blog > posts or anything else documenting the use of Haskell when developing a > mobile application. > > Ideally, I would like something along the lines of having a native UI, a > language bridge, and use Haskell for the core logic. > > My main focus would be getting this to work on Android and iOS. If this > would also work on Blackberry and Windows Phone it would be a plus. > > I have successfully done this using C++ in place of Haskell in the past, but > would really be interested in getting something working using Haskell. Here are a few useful links: https://github.com/ghc-ios https://github.com/neurocyte/ghc-android http://keera.co.uk/blog/2014/08/13/most-inspiring-green-screen-you-will-ever-see/ Last year I managed to build an iOS application with the architecture you describe using the tools in the ghc-ios/ghc-ios-scripts repository in GitHub. I never did manage to get it working for 64-bit ARM, though, due to some issues that were not resolved at the time, but I do remember hearing of someone else getting it working (although I can?t quite remember who it was). The Apple App Store now requires builds to be 64-bit compatible, so this may be a more serious issue nowadays ? or it may be fixed, hopefully! From erantapaa at gmail.com Fri May 27 18:28:26 2016 From: erantapaa at gmail.com (Erik Rantapaa) Date: Fri, 27 May 2016 11:28:26 -0700 (PDT) Subject: [Haskell-cafe] read "2" in a "void" context? Message-ID: <05f13f29-d0f7-4113-a31e-c189746a5eaa@googlegroups.com> Hi fellow Haskellers! If I bring up ghci and evaluate `read 2` I get the error "Prelude.read: no parse" GHCi, version 7.10.2: http://www.haskell.org/ghc/ :? for help Prelude> read "2" *** Exception: Prelude.read: no parse Exactly how is this message coming about? I understand that `read` needs a return type in order to determine which type class instance to run. So, in this case, which type is `read` being asked to return? Thanks, Erik -------------- next part -------------- An HTML attachment was scrubbed... URL: From kane at kane.cx Fri May 27 18:38:23 2016 From: kane at kane.cx (David Kraeutmann) Date: Fri, 27 May 2016 20:38:23 +0200 Subject: [Haskell-cafe] read "2" in a "void" context? In-Reply-To: <05f13f29-d0f7-4113-a31e-c189746a5eaa@googlegroups.com> References: <05f13f29-d0f7-4113-a31e-c189746a5eaa@googlegroups.com> Message-ID: <7e67aacc-0a19-a68f-500f-565303cc8dfe@kane.cx> GHCi enables -XExtendedDefaultRules, which cause read "2" to default to (). On 5/27/2016 8:28 PM, Erik Rantapaa wrote: > Hi fellow Haskellers! > > If I bring up ghci and evaluate `read 2` I get the error "Prelude.read: no > parse" > > GHCi, version 7.10.2: http://www.haskell.org/ghc/ :? for help > Prelude> read "2" > *** Exception: Prelude.read: no parse > > Exactly how is this message coming about? I understand that `read` needs a > return type in order to determine which type class instance to run. So, in > this case, which type is `read` being asked to return? > > Thanks, > Erik > > > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4291 bytes Desc: S/MIME Cryptographic Signature URL: From jeffbrown.the at gmail.com Fri May 27 18:42:19 2016 From: jeffbrown.the at gmail.com (Jeffrey Brown) Date: Fri, 27 May 2016 11:42:19 -0700 Subject: [Haskell-cafe] read "2" in a "void" context? In-Reply-To: <7e67aacc-0a19-a68f-500f-565303cc8dfe@kane.cx> References: <05f13f29-d0f7-4113-a31e-c189746a5eaa@googlegroups.com> <7e67aacc-0a19-a68f-500f-565303cc8dfe@kane.cx> Message-ID: Without a type signature, all GHCI knows: Prelude> :t read "2" read "2" :: Read a => a is that it should return some kind of Read -- that is, something that can be from a string. GHCI is not being asked to return any (concrete) type. If you specify a type -- and if that type can be expressed as a string containing a single digit -- then it works: Prelude> read "2" :: Float 2.0 And otherwise it won't: Prelude> read "2" :: [Float] *** Exception: Prelude.read: no parse You don't necessarily have to provide a type signature, though, if it can be inferred from context: Prelude> floor $ read "2" 2 Prelude> :t floor floor :: (Integral b, RealFrac a) => a -> b Prelude> :t floor $ read "2" floor $ read "2" :: Integral b => b Note that GHCI in this case still does not know exactly the type of (floor $ read "2"), but thanks to the type of floor, it knows enough to proceed. On Fri, May 27, 2016 at 11:38 AM, David Kraeutmann wrote: > GHCi enables -XExtendedDefaultRules, which cause read "2" to default to (). > On 5/27/2016 8:28 PM, Erik Rantapaa wrote: > > Hi fellow Haskellers! > > > > If I bring up ghci and evaluate `read 2` I get the error "Prelude.read: > no > > parse" > > > > GHCi, version 7.10.2: http://www.haskell.org/ghc/ :? for help > > Prelude> read "2" > > *** Exception: Prelude.read: no parse > > > > Exactly how is this message coming about? I understand that `read` needs > a > > return type in order to determine which type class instance to run. So, > in > > this case, which type is `read` being asked to return? > > > > Thanks, > > Erik > > > > > > > > > > _______________________________________________ > > Haskell-Cafe mailing list > > Haskell-Cafe at haskell.org > > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > > > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > -- Jeffrey Benjamin Brown -------------- next part -------------- An HTML attachment was scrubbed... URL: From gershomb at gmail.com Fri May 27 19:14:38 2016 From: gershomb at gmail.com (Gershom B) Date: Fri, 27 May 2016 15:14:38 -0400 Subject: [Haskell-cafe] Announce: Haskell Platform 8.0.1 Message-ID: On behalf of the Haskell Platform team, I'm happy to announce the release of Haskell Platform 8.0.1 Now available at https://www.haskell.org/platform/ This platform includes features initially planned in the "Improving the 'Get Haskell Experience'" proposal of June 2015. [1] * Minimal as well as Full distributions. The minimal distribution only includes GHC core libraries as well as additional tools. This is now the recommended distribution. The Full distribution remains an option for those who want a one-step installer with the broader set of platform libraries preinstalled. * Inclusion of the Stack tool for developing Haskell projects [2] Other highlights of this release include the following * The new cabal 1.24 including the great "new-build" tech preview of nix-like build dependency management [3] * On windows, a cabal/msys setup that allows packages such as "network" to build "out of the box". (almost*) * At long last, prebuilt Linux 32 bit platform installers Changes to Contents: * Some packages have been removed from the installed packages set (both minimal and full) including old-locale, old-time, cgi, and the transitive cgi dependencies: transformers-compat, multipart, and exceptions. * fixed has been added to the platform as a transitive dependency of GLUT. A full list of contents is available at https://www.haskell.org/platform/contents.html Thanks to all the contributors to this release, thanks to all the package and tool maintainers and authors, and a big thanks to the GHC team for putting together such an exciting new compiler release! A fuller list of new GHC changes is available at: https://mail.haskell.org/pipermail/ghc-devs/2016-May/012098.html A fuller list of new cabal changes is available at: http://coldwa.st/e/blog/2016-05-04-Cabal-1-24.html Happy Haskell Hacking all, Gershom [1] http://projects.haskell.org/pipermail/haskell-platform/2015-July/003129.html [2] http://haskellstack.org [3] http://blog.ezyang.com/2016/05/announcing-cabal-new-build-nix-style-local-builds/ * To build "network" and other msys-dependent packages on windows, you will need to augment your cabal config file with the following lines: extra-prog-path: C:\Program Files\Haskell Platform\8.0.1\msys\usr\bin extra-lib-dirs: C:\Program Files\Haskell Platform\8.0.1\mingw\lib extra-include-dirs: C:\Program Files\Haskell Platform\8.0.1\mingw\include From erantapaa at gmail.com Fri May 27 19:35:22 2016 From: erantapaa at gmail.com (Erik Rantapaa) Date: Fri, 27 May 2016 12:35:22 -0700 (PDT) Subject: [Haskell-cafe] read "2" in a "void" context? In-Reply-To: <7e67aacc-0a19-a68f-500f-565303cc8dfe@kane.cx> References: <05f13f29-d0f7-4113-a31e-c189746a5eaa@googlegroups.com> <7e67aacc-0a19-a68f-500f-565303cc8dfe@kane.cx> Message-ID: <399992b3-3f86-41b0-8874-91def3176cde@googlegroups.com> On Friday, May 27, 2016 at 1:38:36 PM UTC-5, David Kraeutmann wrote: > > GHCi enables -XExtendedDefaultRules, which cause read "2" to default to > (). > Ah - thank you very much! Indeed it is a consequence of the ExtendedDefaultRules option: GHCi, version 7.10.2: http://www.haskell.org/ghc/ :? for help Prelude> :set -XNoExtendedDefaultRules Prelude> read "2" :3:1: No instance for (Read a0) arising from a use of ?it? On 5/27/2016 8:28 PM, Erik Rantapaa wrote: > > Hi fellow Haskellers! > > > > If I bring up ghci and evaluate `read 2` I get the error "Prelude.read: > no > > parse" > > > > GHCi, version 7.10.2: http://www.haskell.org/ghc/ :? for help > > Prelude> read "2" > > *** Exception: Prelude.read: no parse > > > > Exactly how is this message coming about? I understand that `read` needs > a > > return type in order to determine which type class instance to run. So, > in > > this case, which type is `read` being asked to return? > > > > Thanks, > > Erik > > > > > > > > > > _______________________________________________ > > Haskell-Cafe mailing list > > Haskel... at haskell.org > > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From danburton.email at gmail.com Fri May 27 20:48:49 2016 From: danburton.email at gmail.com (Dan Burton) Date: Fri, 27 May 2016 13:48:49 -0700 Subject: [Haskell-cafe] [Haskell] Announce: Haskell Platform 8.0.1 In-Reply-To: References: Message-ID: Nice! That was really fast! -- Dan Burton On Fri, May 27, 2016 at 12:14 PM, Gershom B wrote: > On behalf of the Haskell Platform team, I'm happy to announce the release > of > > Haskell Platform 8.0.1 > > Now available at > > https://www.haskell.org/platform/ > > This platform includes features initially planned in the "Improving > the 'Get Haskell Experience'" proposal of June 2015. [1] > > * Minimal as well as Full distributions. The minimal distribution > only includes GHC core libraries as well as additional tools. This is > now the recommended distribution. The Full distribution remains an > option for those who want a one-step installer with the broader set of > platform libraries preinstalled. > > * Inclusion of the Stack tool for developing Haskell projects [2] > > Other highlights of this release include the following > > * The new cabal 1.24 including the great "new-build" tech preview > of nix-like build dependency management [3] > > * On windows, a cabal/msys setup that allows packages such as > "network" to build "out of the box". (almost*) > > * At long last, prebuilt Linux 32 bit platform installers > > Changes to Contents: > > * Some packages have been removed from the installed packages set > (both minimal and full) including old-locale, old-time, cgi, and the > transitive cgi dependencies: transformers-compat, multipart, and > exceptions. > > * fixed has been added to the platform as a transitive dependency of > GLUT. > > A full list of contents is available at > https://www.haskell.org/platform/contents.html > > Thanks to all the contributors to this release, thanks to all the > package and tool maintainers and authors, and a big thanks to the GHC > team for putting together such an exciting new compiler release! > > A fuller list of new GHC changes is available at: > https://mail.haskell.org/pipermail/ghc-devs/2016-May/012098.html > > A fuller list of new cabal changes is available at: > http://coldwa.st/e/blog/2016-05-04-Cabal-1-24.html > > Happy Haskell Hacking all, > Gershom > > [1] > http://projects.haskell.org/pipermail/haskell-platform/2015-July/003129.html > [2] http://haskellstack.org > [3] > http://blog.ezyang.com/2016/05/announcing-cabal-new-build-nix-style-local-builds/ > > * To build "network" and other msys-dependent packages on windows, you > will need to augment your cabal config file with the following lines: > > extra-prog-path: C:\Program Files\Haskell Platform\8.0.1\msys\usr\bin > extra-lib-dirs: C:\Program Files\Haskell Platform\8.0.1\mingw\lib > extra-include-dirs: C:\Program Files\Haskell Platform\8.0.1\mingw\include > _______________________________________________ > Haskell mailing list > Haskell at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell > -------------- next part -------------- An HTML attachment was scrubbed... URL: From parsonsmatt at gmail.com Sat May 28 00:22:13 2016 From: parsonsmatt at gmail.com (Matt) Date: Fri, 27 May 2016 18:22:13 -0600 Subject: [Haskell-cafe] Higher order type functions Message-ID: Hi folks! I'm playing with GHC 8 and have the following type family definend: type family InsertSorted (gt :: k -> k -> Bool) (a :: k) (xs :: [k]) :: [k] where InsertSorted f a '[] = '[a] InsertSorted f a (x ': xs) = If (f a x) (x ': InsertSorted f a xs) (a ': x ': xs) With appropriate type functions, I can evaluate this in GHCi with `:kind!` and it does what I want: ?> :kind! InsertSorted GreaterThan One '[Two, Four] InsertSorted GreaterThan One '[Two, Four] :: [Face] = '['One, 'Two, 'Four] ?> :kind! InsertSorted GreaterThan Queen '[Two, Four] InsertSorted GreaterThan Queen '[Two, Four] :: [Face] = '['Two, 'Four, 'Queen] However, I get an error if I try to use this in a type signature. This code: data Deck (b :: [k]) where Empty :: Deck '[] (:::) :: CardT s f -> Deck xs -> Deck (InsertSorted GreaterThan '(s, f) xs) gives me this error: ? The type family ?GreaterThan? should have 2 arguments, but has been given none ? In the definition of data constructor ?:::? In the data type declaration for ?Deck? What's the best way to use higher order type families? Thanks! Matt Parsons Here's the definitions I'm using for the above code: data Face = One | Two | Three | Four | Five | Six | Seven | Eight | Nine | Jack | Queen | King deriving (Eq, Ord, Bounded, Enum) type family FaceOrd (a :: Face) (b :: Face) :: Ordering where FaceOrd a a = 'EQ FaceOrd a 'One = 'GT FaceOrd 'One a = 'LT FaceOrd a b = FaceOrd (PredFace a) (PredFace b) type family FaceGT (a :: Face) (b :: Face) :: Bool where FaceGT a b = CompK a b == GT class GtK (a :: k) where type GreaterThan (a :: k) (b :: k) :: Bool instance GtK (a :: Face) where type GreaterThan a b = CompK a b == GT -------------- next part -------------- An HTML attachment was scrubbed... URL: From takenobu.hs at gmail.com Sat May 28 07:05:07 2016 From: takenobu.hs at gmail.com (Takenobu Tani) Date: Sat, 28 May 2016 16:05:07 +0900 Subject: [Haskell-cafe] [Haskell] Announce: Haskell Platform 8.0.1 In-Reply-To: References: Message-ID: Hi Platform team, Congratulations! Thank you for great effort :) Regards, Takenobu 2016-05-28 4:14 GMT+09:00 Gershom B : > On behalf of the Haskell Platform team, I'm happy to announce the release > of > > Haskell Platform 8.0.1 > > Now available at > > https://www.haskell.org/platform/ > > This platform includes features initially planned in the "Improving > the 'Get Haskell Experience'" proposal of June 2015. [1] > > * Minimal as well as Full distributions. The minimal distribution > only includes GHC core libraries as well as additional tools. This is > now the recommended distribution. The Full distribution remains an > option for those who want a one-step installer with the broader set of > platform libraries preinstalled. > > * Inclusion of the Stack tool for developing Haskell projects [2] > > Other highlights of this release include the following > > * The new cabal 1.24 including the great "new-build" tech preview > of nix-like build dependency management [3] > > * On windows, a cabal/msys setup that allows packages such as > "network" to build "out of the box". (almost*) > > * At long last, prebuilt Linux 32 bit platform installers > > Changes to Contents: > > * Some packages have been removed from the installed packages set > (both minimal and full) including old-locale, old-time, cgi, and the > transitive cgi dependencies: transformers-compat, multipart, and > exceptions. > > * fixed has been added to the platform as a transitive dependency of > GLUT. > > A full list of contents is available at > https://www.haskell.org/platform/contents.html > > Thanks to all the contributors to this release, thanks to all the > package and tool maintainers and authors, and a big thanks to the GHC > team for putting together such an exciting new compiler release! > > A fuller list of new GHC changes is available at: > https://mail.haskell.org/pipermail/ghc-devs/2016-May/012098.html > > A fuller list of new cabal changes is available at: > http://coldwa.st/e/blog/2016-05-04-Cabal-1-24.html > > Happy Haskell Hacking all, > Gershom > > [1] > http://projects.haskell.org/pipermail/haskell-platform/2015-July/003129.html > [2] http://haskellstack.org > [3] > http://blog.ezyang.com/2016/05/announcing-cabal-new-build-nix-style-local-builds/ > > * To build "network" and other msys-dependent packages on windows, you > will need to augment your cabal config file with the following lines: > > extra-prog-path: C:\Program Files\Haskell Platform\8.0.1\msys\usr\bin > extra-lib-dirs: C:\Program Files\Haskell Platform\8.0.1\mingw\lib > extra-include-dirs: C:\Program Files\Haskell Platform\8.0.1\mingw\include > _______________________________________________ > Haskell mailing list > Haskell at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hjgtuyl at chello.nl Sat May 28 10:29:41 2016 From: hjgtuyl at chello.nl (Henk-Jan van Tuyl) Date: Sat, 28 May 2016 12:29:41 +0200 Subject: [Haskell-cafe] Mobile Development In-Reply-To: References: Message-ID: On Fri, 27 May 2016 14:42:37 +0200, Justin Wood wrote: > I'm wondering if anyone has any experience they can share, know of any > blog > posts or anything else documenting the use of Haskell when developing a > mobile application. > > Ideally, I would like something along the lines of having a native UI, a > language bridge, and use Haskell for the core logic. > > My main focus would be getting this to work on Android and iOS. If this > would also work on Blackberry and Windows Phone it would be a plus. : See: - https://wiki.haskell.org/Android - https://wiki.haskell.org/IPhone Regards, Henk-Jan van Tuyl -- Folding at home What if you could share your unused computer power to help find a cure? In just 5 minutes you can join the world's biggest networked computer and get us closer sooner. Watch the video. http://folding.stanford.edu/ http://Van.Tuyl.eu/ http://members.chello.nl/hjgtuyl/tourdemonad.html Haskell programming -- From ollie at ocharles.org.uk Sat May 28 11:23:25 2016 From: ollie at ocharles.org.uk (Oliver Charles) Date: Sat, 28 May 2016 11:23:25 +0000 Subject: [Haskell-cafe] Higher order type functions In-Reply-To: References: Message-ID: I believe that in order to pass around this partially-applied GreaterThan symbol you're going to need to use defunctionalisation. Richard Eisenberg has a blog post on this ("defunctionalisation for the win") which should get you on the right track. Hope this helps, and happy to be corrected by others of I'm sending you down the wrong path! Ollie On Sat, 28 May 2016, 1:22 a.m. Matt, wrote: > Hi folks! > > I'm playing with GHC 8 and have the following type family definend: > > type family InsertSorted (gt :: k -> k -> Bool) (a :: k) (xs :: [k]) :: > [k] where > InsertSorted f a '[] = '[a] > InsertSorted f a (x ': xs) = If (f a x) (x ': InsertSorted f a xs) (a > ': x ': xs) > > With appropriate type functions, I can evaluate this in GHCi with `:kind!` > and it does what I want: > > ?> :kind! InsertSorted GreaterThan One '[Two, Four] > InsertSorted GreaterThan One '[Two, Four] :: [Face] > = '['One, 'Two, 'Four] > ?> :kind! InsertSorted GreaterThan Queen '[Two, Four] > InsertSorted GreaterThan Queen '[Two, Four] :: [Face] > = '['Two, 'Four, 'Queen] > > However, I get an error if I try to use this in a type signature. This > code: > > data Deck (b :: [k]) where > Empty :: Deck '[] > (:::) :: CardT s f > -> Deck xs > -> Deck (InsertSorted GreaterThan '(s, f) xs) > > gives me this error: > > ? The type family ?GreaterThan? should have 2 arguments, but has been > given > none > ? In the definition of data constructor ?:::? > In the data type declaration for ?Deck? > > > What's the best way to use higher order type families? > > Thanks! > Matt Parsons > > Here's the definitions I'm using for the above code: > > data Face > = One | Two | Three | Four | Five | Six | Seven | Eight | Nine > | Jack | Queen | King > deriving (Eq, Ord, Bounded, Enum) > > type family FaceOrd (a :: Face) (b :: Face) :: Ordering where > FaceOrd a a = 'EQ > FaceOrd a 'One = 'GT > FaceOrd 'One a = 'LT > FaceOrd a b = FaceOrd (PredFace a) (PredFace b) > > type family FaceGT (a :: Face) (b :: Face) :: Bool where > FaceGT a b = CompK a b == GT > > class GtK (a :: k) where > type GreaterThan (a :: k) (b :: k) :: Bool > > instance GtK (a :: Face) where > type GreaterThan a b = CompK a b == GT > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From till at iws.cs.uni-magdeburg.de Sat May 28 14:33:24 2016 From: till at iws.cs.uni-magdeburg.de (Till Mossakowski) Date: Sat, 28 May 2016 16:33:24 +0200 Subject: [Haskell-cafe] Fwd: representing institutions in haskell In-Reply-To: <573B14B4.5030103@rickmurphy.org> References: <573B13DF.5070801@rickmurphy.org> <573B14B4.5030103@rickmurphy.org> Message-ID: <5749AC34.9070602@iks.cs.ovgu.de> Dear Rick, actually, in the Hets system [1], which is one of the largest Haskell programs, we have represented logics as institutions since 2002. Hets comprises of about 25 logics represented as institutions, including propositional logic, first-order logic, higher-oder logic, modal logic, OWL, and even some functional programming language. Hets provides parsing, static analysis, and proof management for logical theories formulated within these institutions (and also heterogeneous theories spanning several institutions). Interfaces to various theorem provers, SAT solvers and model finders are included. Hets' input language is the Distributed Ontology, Model and Specification language (DOL) [2], which has been standardized by the Object Management Group (OMG). More specifically, Hets employs a type class "Category" for representing categories, with functions for identities, domain, codomain and composition. On top of this, institutions form a multi-parameter type class "Logic", with a representation of signatures and signature morphisms as a category. The set of sentences is represented as one parameter type. This is a pragmatic decision, since in most institutions, sentences are uniform over signatures, and making this dependent on signature would be much more complicated. But many functions on sentences depend on a signature. Sentence translation along a signature morphism is represented by a function of the type class as well. Models and satisfaction are generally not represented due to their (in general) infinitary nature. But in some case, we represent models as certain theories, e.g. when processing the output of some model finder. Such models can even be translated using institution comorphisms. That said, we are interested in improving the representations of institutions in Hets, e.g. by making more using some libraries for category theory that have not been available in 2002 when we started Hets. However, I must admit that I did not understand your representation, Rick. Could you explain its general principles? What is the purpose of having "data Sign a = Sign a"? Why do conjunction and disjunction play such a role, given that there are institutions like equational logic that neither have conjunction nor disjunction? I could I execute your code, neither with ghc 7.6.3, nor ghc 8.0.2. I suggest that you choose some simple logic, like propositional logic, and represent it as an institution in Haskell with your approach. Then we will have a better basis for discussion. Best, Till [1] http://hets.eu [2] http://dol-omg.org Am 17.05.2016 um 14:55 schrieb rick: > Hello Christian: > > I thought I should send this to you separately in case you are not on > the Haskell list any more. > > You may enjoy the samples below which use some standard Haskell > libraries that may not have been available when you and Till started > work on HETS. > > -- > Rick > > -------- Forwarded Message -------- > Subject: [Haskell-cafe] representing institutions in haskell > Date: Mon, 16 May 2016 15:13:34 -0400 > From: rick > To: haskell-cafe at haskell.org > > Has anyone here taken an interest in representing institutions [1] in > Haskell? > > Institutions originated in work on CLEAR [2] which was the first > algebraic specification language with rigorous semantics. > > Institutions take some time to explain, or unravel if you follow the > reference, but they come with a convenient slogan : "Truth is invariant > under change of notation." > > The stretch goal of institutions is transforming logics while preserving > satisfaction. > > They are conceived in terms of categorical abstractions, so it's natural > to represent them in categories. I hope some folks here find > institutions a useful domain to apply their work on categories. > > I've attached two samples in Haskell that uses some standard libraries : > Arrow, Monad, Category and Dual. > > The first sample, ri-0, outlines the essentials. The category of > signatures, constructions in the categories, signature morphisms, > sentences, models and the satisfaction condition. > > Using plain old Nat reduces the complexity of the exposition. > > I provide a constructive witness for satisfaction of the morphism from > conjunction to disjunction. > > You may recognize that I borrow some Bird/Hinze notation on Functors > like mapSign. And you find some experiments with Quickcheck and Yampa. > > Ri-0 runs from main, but just computes the witness to the satisfaction > condition. > > The second sample, ri-1, builds on ri-0. Rather than Nat, I use Either > to inject disjunction into the exposition. The exposition becomes more > complex, but the increased complexity is justified because maintaining > satisfaction under change on notation is central to institutions. > > The functions prodSum takes conjunction to disjunction and sumProd takes > disjunction to conjunction. I owe a citation to @BartoszMilewski and his > work on categories for programmers where I first saw these functions. > > The satisfaction condition and witness appear more complex in ri-1, but > its really just the substitution of the signature morphism on product > and sum rather than plain old Nat as in ri-0. > > I also plan a better write up, but before I do I expect to learn much > from an email exchange with interested folks here. > > Thanks for taking a look at this material. > > 1. https://cseweb.ucsd.edu/~goguen/pps/ins.ps > > 2. http://hopl.info/showlanguage.prx?exp=945 > From nicola.gigante at gmail.com Sat May 28 15:04:32 2016 From: nicola.gigante at gmail.com (Nicola Gigante) Date: Sat, 28 May 2016 17:04:32 +0200 Subject: [Haskell-cafe] Quantum Programming EDSLs other than Quipper Message-ID: <96FCBE45-47DB-4573-995D-B32E7C58B9BB@gmail.com> Hi all, Quipper [1] is a well-known library that provides an EDSL for writing and simulating quantum algorithms in Haskell. I was wondering if there was any other attempt to design an EDSL in Haskell to express quantum algorithms. In particular, Quipper is not able to statically ensure that the algorithm written is physically meaningful, as one could violate the "non-cloning property", for example (a qubit cannot be copied, for those who do not speak quantumly). Violations like this are detected at runtime when simulating the algorithm or when producing the corresponding circuit as output. Authors of Quipper already said that some of those properties could be possible to check ?if Haskell had linear types?. The point is that Haskell's support for dependently typed programming has grown quite a lot in the last years, and I think that, at least theoretically, something better can now be achieved. So do anyone know any more recent attempt to express quantum computations in an Haskell EDSL that leverages cutting-edge type-level features to statically check for physically meaningful programs? Greetings, Nicola [1]: http://www.mathstat.dal.ca/~selinger/quipper/ From D.J.Duke at leeds.ac.uk Sat May 28 14:58:12 2016 From: D.J.Duke at leeds.ac.uk (David Duke) Date: Sat, 28 May 2016 15:58:12 +0100 Subject: [Haskell-cafe] Reminder: Functional High-Performance Computing 2016 Message-ID: <65C8963D-03AD-4FE3-9CF0-4953FC394EF4@leeds.ac.uk> Dear colleagues, A reminder of the approaching paper deadline (10th June) for FHPC 2016 ... ====================================================================== CALL FOR PAPERS FHPC 2016 The 5th ACM SIGPLAN Workshop on Functional High-Performance Computing Nara, Japan September 22, 2016 https://sites.google.com/site/fhpcworkshops/ Co-located with the International Conference on Functional Programming (ICFP 2016) Submission Deadline: Friday, 10 June, 2016 (anywhere on earth) ====================================================================== The FHPC workshop aims at bringing together researchers exploring uses of functional (or more generally, declarative or high-level) programming technology in application domains where high performance is essential. The aim of the meeting is to enable sharing of results, experiences, and novel ideas about how high-level, declarative specifications of computationally challenging problems can serve as maintainable and portable code that approaches (or even exceeds) the performance of machine-oriented imperative implementations. All aspects of performance critical programming and parallel programming are in-scope for the workshop, irrespective of hardware target. This includes both traditional large-scale scientific computing (HPC), as well as work targeting single node systems with SMPs, GPUs, FPGAs, or embedded processors. It is becoming apparent that radically new and well founded methodologies for programming such systems are required to address their inherent complexity and to reconcile execution performance with programming productivity. Experience reports are also welcome. Proceedings: ============ FHPC 2016 seeks to encourage a range of submissions, focussing on work in progress and facilitating early exchange of ideas and open discussion on innovative and/or emerging results. To this end submissions should take the form of short (maximum 6 page) papers. Accepted papers will be published by the ACM and will appear in the ACM Digital Library. * Submissions due: Friday, 10 June, 2016 (anywhere on earth) * Author notification: Friday, 8 July, 2016 * Final copy due: Sunday, 31 July, 2016 Submitted papers must be in portable document format (PDF), formatted according to the ACM SIGPLAN style guidelines (2 column, 9pt format). See http://www.sigplan.org/authorInformation.htm for more information and style files. Papers should be no longer than 6 pages. Contributions to FHPC 2016 should be submitted via Easychair, at the following URL: * https://www.easychair.org/conferences/?conf=fhpc16 The FHPC workshops adhere to the ACM SIGPLAN policies regarding programme committee contributions and republication. Any paper submitted must adhere to ACM SIGPLAN's republication policy. PC member submissions are welcome, but will be reviewed to a higher standard. http://www.sigplan.org/Resources/Policies/Review http://www.sigplan.org/Resources/Policies/Republication Travel Support: =============== Student attendees with accepted papers can apply for a SIGPLAN PAC grant to help cover travel expenses. PAC also offers other support, such as for child-care expenses during the meeting or for travel costs for companions of SIGPLAN members with physical disabilities, as well as for travel from locations outside of North America and Europe. For details on the PAC programme, see its web page (http://www.sigplan.org/PAC.htm). Programme Committee: ==================== David Duke (co-chair) University of Leeds, UK Yukiyoshi Kameyama (co-chair) University of Tsukuba, Japan Baris Aktemur ?zye?in University, Turkey Marco Aldinucci University of Torino, Italy Jost Berthold Commonwealth Bank, Australia Kei Davis Los Alamos National Laboratory, USA Kento Emoto Kyushu Institute of Technology, Japan Zhenjiang Hu National Institute of Informatics, Japan Ben Lippmeier University of New South Wales, Australia Rita Loogen University of Marburg, Germany Geoffrey Mainland Drexel University, USA Mike Rainey INRIA, France Mary Sheeran Chalmers University of Technology, Sweden Satnam Singh Facebook, UK From sepp2k at googlemail.com Sat May 28 15:27:47 2016 From: sepp2k at googlemail.com (Sebastian Hungerecker) Date: Sat, 28 May 2016 17:27:47 +0200 Subject: [Haskell-cafe] read "2" in a "void" context? In-Reply-To: References: <05f13f29-d0f7-4113-a31e-c189746a5eaa@googlegroups.com> <7e67aacc-0a19-a68f-500f-565303cc8dfe@kane.cx> Message-ID: <3a33f2c3-af8d-521a-83ff-638967af7470@googlemail.com> On 27.05.2016 20:42, Jeffrey Brown wrote: > Without a type signature, all GHCI knows: > > Prelude> :t read "2" > read "2" :: Read a => a > > is that it should return some kind of Read -- that is, something that > can be from a string. GHCI is not being asked to return any (concrete) type. If that were true (which it would be without extensions), the code would fail to compile rather than throwing a runtime exception. But as your parent post stated, GHCi enables ExtendedDefaultRules by default, defaulting to (). Note that this means that `read "()"` works without any type annotations and produces (). > You don't necessarily have to provide a type signature, though, if it > can be inferred from context: > > Prelude> floor $ read "2" > 2 > Prelude> :t floor > floor :: (Integral b, RealFrac a) => a -> b > Prelude> :t floor $ read "2" > floor $ read "2" :: Integral b => b > > Note that GHCI in this case still does not know exactly the type of > (floor $ read "2"), but thanks to the type of floor, it knows enough to > proceed. That's not accurate. If it did not know which numeric type to use, it would not be able to pick which overload of read to use (it's not like all RealFracs share the same implementation of read), so it wouldn't be able to produce a result. So again defaulting rules apply (this time even without extensions) and the `read "2"` in `floor $ read "2"` produces a Double (unless you declare a different default type). From aovieth at gmail.com Sat May 28 16:00:44 2016 From: aovieth at gmail.com (Alexander Vieth) Date: Sat, 28 May 2016 12:00:44 -0400 Subject: [Haskell-cafe] Higher order type functions In-Reply-To: References: Message-ID: Ollie has sent you down the right path. I just want to add these relevant links https://www.reddit.com/r/haskell/comments/4354x7/promoting_the_arrow_type/?ref=share&ref_source=link https://github.com/avieth/type-function Alex On Sat, May 28, 2016 at 7:23 AM, Oliver Charles wrote: > I believe that in order to pass around this partially-applied GreaterThan > symbol you're going to need to use defunctionalisation. Richard Eisenberg > has a blog post on this ("defunctionalisation for the win") which should > get you on the right track. > > Hope this helps, and happy to be corrected by others of I'm sending you > down the wrong path! > > Ollie > > On Sat, 28 May 2016, 1:22 a.m. Matt, wrote: > >> Hi folks! >> >> I'm playing with GHC 8 and have the following type family definend: >> >> type family InsertSorted (gt :: k -> k -> Bool) (a :: k) (xs :: [k]) :: >> [k] where >> InsertSorted f a '[] = '[a] >> InsertSorted f a (x ': xs) = If (f a x) (x ': InsertSorted f a xs) (a >> ': x ': xs) >> >> With appropriate type functions, I can evaluate this in GHCi with >> `:kind!` and it does what I want: >> >> ?> :kind! InsertSorted GreaterThan One '[Two, Four] >> InsertSorted GreaterThan One '[Two, Four] :: [Face] >> = '['One, 'Two, 'Four] >> ?> :kind! InsertSorted GreaterThan Queen '[Two, Four] >> InsertSorted GreaterThan Queen '[Two, Four] :: [Face] >> = '['Two, 'Four, 'Queen] >> >> However, I get an error if I try to use this in a type signature. This >> code: >> >> data Deck (b :: [k]) where >> Empty :: Deck '[] >> (:::) :: CardT s f >> -> Deck xs >> -> Deck (InsertSorted GreaterThan '(s, f) xs) >> >> gives me this error: >> >> ? The type family ?GreaterThan? should have 2 arguments, but has been >> given >> none >> ? In the definition of data constructor ?:::? >> In the data type declaration for ?Deck? >> >> >> What's the best way to use higher order type families? >> >> Thanks! >> Matt Parsons >> >> Here's the definitions I'm using for the above code: >> >> data Face >> = One | Two | Three | Four | Five | Six | Seven | Eight | Nine >> | Jack | Queen | King >> deriving (Eq, Ord, Bounded, Enum) >> >> type family FaceOrd (a :: Face) (b :: Face) :: Ordering where >> FaceOrd a a = 'EQ >> FaceOrd a 'One = 'GT >> FaceOrd 'One a = 'LT >> FaceOrd a b = FaceOrd (PredFace a) (PredFace b) >> >> type family FaceGT (a :: Face) (b :: Face) :: Bool where >> FaceGT a b = CompK a b == GT >> >> class GtK (a :: k) where >> type GreaterThan (a :: k) (b :: k) :: Bool >> >> instance GtK (a :: Face) where >> type GreaterThan a b = CompK a b == GT >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >> > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From parsonsmatt at gmail.com Sat May 28 17:21:43 2016 From: parsonsmatt at gmail.com (Matt) Date: Sat, 28 May 2016 11:21:43 -0600 Subject: [Haskell-cafe] Higher order type functions In-Reply-To: References: Message-ID: Fantastic, thanks so much! Matt Parsons On Sat, May 28, 2016 at 10:00 AM, Alexander Vieth wrote: > Ollie has sent you down the right path. I just want to add these relevant > links > > > https://www.reddit.com/r/haskell/comments/4354x7/promoting_the_arrow_type/?ref=share&ref_source=link > https://github.com/avieth/type-function > > Alex > > On Sat, May 28, 2016 at 7:23 AM, Oliver Charles > wrote: > >> I believe that in order to pass around this partially-applied GreaterThan >> symbol you're going to need to use defunctionalisation. Richard Eisenberg >> has a blog post on this ("defunctionalisation for the win") which should >> get you on the right track. >> >> Hope this helps, and happy to be corrected by others of I'm sending you >> down the wrong path! >> >> Ollie >> >> On Sat, 28 May 2016, 1:22 a.m. Matt, wrote: >> >>> Hi folks! >>> >>> I'm playing with GHC 8 and have the following type family definend: >>> >>> type family InsertSorted (gt :: k -> k -> Bool) (a :: k) (xs :: [k]) :: >>> [k] where >>> InsertSorted f a '[] = '[a] >>> InsertSorted f a (x ': xs) = If (f a x) (x ': InsertSorted f a xs) >>> (a ': x ': xs) >>> >>> With appropriate type functions, I can evaluate this in GHCi with >>> `:kind!` and it does what I want: >>> >>> ?> :kind! InsertSorted GreaterThan One '[Two, Four] >>> InsertSorted GreaterThan One '[Two, Four] :: [Face] >>> = '['One, 'Two, 'Four] >>> ?> :kind! InsertSorted GreaterThan Queen '[Two, Four] >>> InsertSorted GreaterThan Queen '[Two, Four] :: [Face] >>> = '['Two, 'Four, 'Queen] >>> >>> However, I get an error if I try to use this in a type signature. This >>> code: >>> >>> data Deck (b :: [k]) where >>> Empty :: Deck '[] >>> (:::) :: CardT s f >>> -> Deck xs >>> -> Deck (InsertSorted GreaterThan '(s, f) xs) >>> >>> gives me this error: >>> >>> ? The type family ?GreaterThan? should have 2 arguments, but has >>> been given >>> none >>> ? In the definition of data constructor ?:::? >>> In the data type declaration for ?Deck? >>> >>> >>> What's the best way to use higher order type families? >>> >>> Thanks! >>> Matt Parsons >>> >>> Here's the definitions I'm using for the above code: >>> >>> data Face >>> = One | Two | Three | Four | Five | Six | Seven | Eight | Nine >>> | Jack | Queen | King >>> deriving (Eq, Ord, Bounded, Enum) >>> >>> type family FaceOrd (a :: Face) (b :: Face) :: Ordering where >>> FaceOrd a a = 'EQ >>> FaceOrd a 'One = 'GT >>> FaceOrd 'One a = 'LT >>> FaceOrd a b = FaceOrd (PredFace a) (PredFace b) >>> >>> type family FaceGT (a :: Face) (b :: Face) :: Bool where >>> FaceGT a b = CompK a b == GT >>> >>> class GtK (a :: k) where >>> type GreaterThan (a :: k) (b :: k) :: Bool >>> >>> instance GtK (a :: Face) where >>> type GreaterThan a b = CompK a b == GT >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >>> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Sat May 28 17:53:20 2016 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Sat, 28 May 2016 13:53:20 -0400 Subject: [Haskell-cafe] Quantum Programming EDSLs other than Quipper In-Reply-To: <96FCBE45-47DB-4573-995D-B32E7C58B9BB@gmail.com> References: <96FCBE45-47DB-4573-995D-B32E7C58B9BB@gmail.com> Message-ID: Hello ! So my colleagues and I have some linear logical language engineering in various states of immaturity at github.com/hopper-lang Last fall Jeff polakow presented a paper at Haskell symposium or Icfp (forget which) for embedding linear types in Haskell , might be worth googling around for a copy of that paper (Google scholar might get you a non paywalled pdf) There's some cool stuff related to this I hope to share with the community in the near future, but that's all I can offer off the cuff On Saturday, May 28, 2016, Nicola Gigante wrote: > Hi all, > > Quipper [1] is a well-known library that provides an EDSL for writing and > simulating quantum algorithms in Haskell. > > I was wondering if there was any other attempt to design an EDSL in Haskell > to express quantum algorithms. > > In particular, Quipper is not able to statically ensure that the algorithm > written is physically meaningful, as one could violate the "non-cloning > property", > for example (a qubit cannot be copied, for those who do not speak > quantumly). > Violations like this are detected at runtime when simulating the algorithm > or when producing the corresponding circuit as output. > > Authors of Quipper already said that some of those properties could be > possible to check ?if Haskell had linear types?. The point is that > Haskell's > support for dependently typed programming has grown quite a lot in > the last years, and I think that, at least theoretically, something better > can > now be achieved. > > So do anyone know any more recent attempt to express quantum computations > in an Haskell EDSL that leverages cutting-edge type-level features to > statically check for physically meaningful programs? > > Greetings, > Nicola > > > [1]: http://www.mathstat.dal.ca/~selinger/quipper/ > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicola.gigante at gmail.com Sat May 28 18:39:39 2016 From: nicola.gigante at gmail.com (Nicola Gigante) Date: Sat, 28 May 2016 20:39:39 +0200 Subject: [Haskell-cafe] Quantum Programming EDSLs other than Quipper In-Reply-To: References: <96FCBE45-47DB-4573-995D-B32E7C58B9BB@gmail.com> Message-ID: Il giorno 28 mag 2016, alle ore 19:53, Carter Schonwald ha scritto: > > Hello ! > So my colleagues and I have some linear logical language engineering in various states of immaturity at github.com/hopper-lang > Nice! I will take a look! > Last fall Jeff polakow presented a paper at Haskell symposium or Icfp (forget which) for embedding linear types in Haskell , might be worth googling around for a copy of that paper (Google scholar might get you a non paywalled pdf) > Yes, I saw his paper and it was indeed what made me think about what Quipper authors said. > There's some cool stuff related to this I hope to share with the community in the near future, but that's all I can offer off the cuff Then I hope the near future comes soon enough ;) Greetings, Nicola -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Sat May 28 19:25:18 2016 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Sat, 28 May 2016 12:25:18 -0700 Subject: [Haskell-cafe] Quantum Programming EDSLs other than Quipper In-Reply-To: References: <96FCBE45-47DB-4573-995D-B32E7C58B9BB@gmail.com> Message-ID: https://github.com/NICTA/cogent/ is also a (very different!) linear logical language thats recently been made public by nicta, the associated papers on their projects are very illuminating. and either way, thers a lot of great theoretical and semi applied work intersecting with linear logical semantics thats ripe for use :) On Sat, May 28, 2016 at 11:39 AM, Nicola Gigante wrote: > Il giorno 28 mag 2016, alle ore 19:53, Carter Schonwald < > carter.schonwald at gmail.com> ha scritto: > > Hello ! > So my colleagues and I have some linear logical language engineering in > various states of immaturity at github.com/hopper-lang > > > Nice! I will take a look! > > Last fall Jeff polakow presented a paper at Haskell symposium or Icfp > (forget which) for embedding linear types in Haskell , might be worth > googling around for a copy of that paper (Google scholar might get you a > non paywalled pdf) > > > Yes, I saw his paper and it was indeed what made me think about what > Quipper authors said. > > There's some cool stuff related to this I hope to share with the community > in the near future, but that's all I can offer off the cuff > >> >> > Then I hope the near future comes soon enough ;) > > Greetings, > Nicola > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ch.howard at zoho.com Sun May 29 04:33:29 2016 From: ch.howard at zoho.com (Christopher Howard) Date: Sat, 28 May 2016 20:33:29 -0800 Subject: [Haskell-cafe] Testing for different dependency versions? Message-ID: <574A7119.6010603@zoho.com> Hi, I was wondering: what is the most practical way to go about testing or otherwise determining if your packaged library works with other dependency versions? E.g., cabal init specified base 4.6 because that is what happens to be installed on my Debian Jessie system, but that wouldn't even build on hackage. -- http://justonemoremathproblem.com To protect my privacy, please use PGP encryption. It's free and easy to use! My public key ID is 0x340EA95A (pgp.mit.edu). From simon.jakobi at googlemail.com Sun May 29 05:46:40 2016 From: simon.jakobi at googlemail.com (Simon Jakobi) Date: Sun, 29 May 2016 07:46:40 +0200 Subject: [Haskell-cafe] Testing for different dependency versions? In-Reply-To: References: <574A7119.6010603@zoho.com> Message-ID: (I'm sending this again because I had subscribed to the mailing list with a different email address) Hi! I'm not sure if there's a better tool out there but I think stack (http://haskellstack.org/) is pretty convenient for testing a package with different versions of base and other packages on the same system. To test your package with base-4.7 you'd simply run stack test --resolver ghc-7.8 --install-ghc To test your package with base-4.8.2.0 and pkg-x-1.2.3 you'd save the following in a stack.yaml in the same directory as your cabal file: resolver: ghc-7.10.3 extra-deps: - pkg-x-1.2.3 Then run stack solver --update-config to add the remaining dependencies and stack test to build the package and run the tests. If you have your package on Github you can also use Travis CI to test your package with different configurations: http://docs.haskellstack.org/en/stable/travis_ci/ Hope that helps! Simon From simon.jakobi at googlemail.com Sun May 29 05:55:29 2016 From: simon.jakobi at googlemail.com (Simon Jakobi) Date: Sun, 29 May 2016 07:55:29 +0200 Subject: [Haskell-cafe] Testing for different dependency versions? In-Reply-To: References: <574A7119.6010603@zoho.com> Message-ID: > To test your package with base-4.7 you'd simply run > > stack test --resolver ghc-7.8 --install-ghc Oh, actually that wouldn't be enough if you have more dependencies than just base. Try stack init --resolver ghc-7.8 --solver --install-ghc stack test instead! From carter.schonwald at gmail.com Sun May 29 06:13:14 2016 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Sat, 28 May 2016 23:13:14 -0700 Subject: [Haskell-cafe] Testing for different dependency versions? In-Reply-To: <574A7119.6010603@zoho.com> References: <574A7119.6010603@zoho.com> Message-ID: Many libraries use Travis ci and the tooling hvr maintains for making it super nice to use. Lens and vector and a bajillion other libs do a whole build matrix of ghc versions On Saturday, May 28, 2016, Christopher Howard wrote: > Hi, I was wondering: what is the most practical way to go about testing > or otherwise determining if your packaged library works with other > dependency versions? E.g., cabal init specified base 4.6 because that is > what happens to be installed on my Debian Jessie system, but that > wouldn't even build on hackage. > > -- > http://justonemoremathproblem.com > To protect my privacy, please use PGP encryption. It's free and easy > to use! My public key ID is 0x340EA95A (pgp.mit.edu). > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rrnewton at gmail.com Sun May 29 17:09:54 2016 From: rrnewton at gmail.com (Ryan Newton) Date: Sun, 29 May 2016 13:09:54 -0400 Subject: [Haskell-cafe] JSON parser that returns the rest of the string that was not used Message-ID: As someone who spent many years putting data in S-expression format, it seems natural to me to write multiple S-expressions (or JSON objects) to a file, and expect a reader to be able to read them back one at a time. This seems comparatively uncommon in the JSON world. Accordingly, it looks like the most popular JSON parsing lib, Aeson, doesn't directly provide this functionality. Functions like decode just return a "Maybe a", not the left-over input, meaning that you would need to somehow split up your multi-object file before attempting to parse, which is annoying and error prone. It looks like maybe you can get Aeson to do what I want by dropping down to the attoparsec layer and messing with IResult. But is there a better way to do this? Would this be a good convenience routine to add to aeson in a PR? I.e. would anyone else use this? Thanks, -Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: From uguu at installgentoo.com Sun May 29 17:23:35 2016 From: uguu at installgentoo.com (Sanae) Date: Sun, 29 May 2016 10:23:35 -0700 Subject: [Haskell-cafe] JSON parser that returns the rest of the string that was not used In-Reply-To: References: Message-ID: <1464542615.25383.8.camel@installgentoo.com> You could drop down to the attoparsec layer, but instead of messing with IResults, use it to make another parser that will parse all the objects in the file. E.g. ?json `sepBy` skipSpace :: Parser [Value] sepBy and skipSpace both taken from Data.Attoparsec.Text On Sun, 2016-05-29 at 13:09 -0400, Ryan Newton wrote: > As someone who spent many years putting data in S-expression format, > it seems natural to me to write multiple S-expressions (or JSON > objects) to a file, and expect a reader to be able to read them back > one at a time. > > This seems comparatively uncommon in the JSON world.? Accordingly, it > looks like the most popular JSON parsing lib, Aeson, doesn't directly > provide this functionality.? Functions like decode just return a > "Maybe a", not the left-over input, meaning that you would need to > somehow split up your multi-object file before attempting to parse, > which is annoying and error prone. > > It looks like maybe you can get Aeson to do what I want by dropping > down to the attoparsec layer and messing with IResult. > > But is there a better way to do this?? Would this be a good > convenience routine to add to aeson in a PR?? I.e. would anyone else > use this? > > Thanks, > ? -Ryan > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.tetley at gmail.com Sun May 29 17:53:51 2016 From: stephen.tetley at gmail.com (Stephen Tetley) Date: Sun, 29 May 2016 18:53:51 +0100 Subject: [Haskell-cafe] JSON parser that returns the rest of the string that was not used In-Reply-To: References: Message-ID: Hi Ryan Isn't this a problem of JSON rather than it's parsers? That's too say I believe (but could easily be wrong...) that a file with multiple JSON objects would be ill-formed; it would be well-formed if the multiple objects were in a single top-level array. On 29 May 2016 at 18:09, Ryan Newton wrote: > As someone who spent many years putting data in S-expression format, it > seems natural to me to write multiple S-expressions (or JSON objects) to a > file, and expect a reader to be able to read them back one at a time. > > This seems comparatively uncommon in the JSON world. Accordingly, it looks > like the most popular JSON parsing lib, Aeson, doesn't directly provide this > functionality. Functions like decode just return a "Maybe a", not the > left-over input, meaning that you would need to somehow split up your > multi-object file before attempting to parse, which is annoying and error > prone. > > It looks like maybe you can get Aeson to do what I want by dropping down to > the attoparsec layer and messing with IResult. > > But is there a better way to do this? Would this be a good convenience > routine to add to aeson in a PR? I.e. would anyone else use this? > > Thanks, > -Ryan > > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > From nukasu.kanaka at gmail.com Sun May 29 18:48:18 2016 From: nukasu.kanaka at gmail.com (Nikita Volkov) Date: Sun, 29 May 2016 18:48:18 +0000 Subject: [Haskell-cafe] JSON parser that returns the rest of the string that was not used In-Reply-To: References: Message-ID: I know of at least two packages providing the incremental JSON parsing functionality: http://hackage.haskell.org/package/json-stream http://hackage.haskell.org/package/json-incremental-decoder Being the author of the latter one I recommend checking out both. ??, 29 ??? 2016 ?. ? 20:10, Ryan Newton : > As someone who spent many years putting data in S-expression format, it > seems natural to me to write multiple S-expressions (or JSON objects) to a > file, and expect a reader to be able to read them back one at a time. > > This seems comparatively uncommon in the JSON world. Accordingly, it > looks like the most popular JSON parsing lib, Aeson, doesn't directly > provide this functionality. Functions like decode just return a "Maybe a", > not the left-over input, meaning that you would need to somehow split up > your multi-object file before attempting to parse, which is annoying and > error prone. > > It looks like maybe you can get Aeson to do what I want by dropping down > to the attoparsec layer and messing with IResult. > > But is there a better way to do this? Would this be a good convenience > routine to add to aeson in a PR? I.e. would anyone else use this? > > Thanks, > -Ryan > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adam at bergmark.nl Sun May 29 20:28:01 2016 From: adam at bergmark.nl (Adam Bergmark) Date: Sun, 29 May 2016 22:28:01 +0200 Subject: [Haskell-cafe] JSON parser that returns the rest of the string that was not used In-Reply-To: References: Message-ID: For aeson, use the Parser/attoparsec module https://hackage.haskell.org/package/aeson-0.11.2.0/docs/Data-Aeson-Parser.html On Sun, May 29, 2016 at 8:48 PM, Nikita Volkov wrote: > I know of at least two packages providing the incremental JSON parsing > functionality: > http://hackage.haskell.org/package/json-stream > http://hackage.haskell.org/package/json-incremental-decoder > > Being the author of the latter one I recommend checking out both. > > ??, 29 ??? 2016 ?. ? 20:10, Ryan Newton : > >> As someone who spent many years putting data in S-expression format, it >> seems natural to me to write multiple S-expressions (or JSON objects) to a >> file, and expect a reader to be able to read them back one at a time. >> >> This seems comparatively uncommon in the JSON world. Accordingly, it >> looks like the most popular JSON parsing lib, Aeson, doesn't directly >> provide this functionality. Functions like decode just return a "Maybe a", >> not the left-over input, meaning that you would need to somehow split up >> your multi-object file before attempting to parse, which is annoying and >> error prone. >> >> It looks like maybe you can get Aeson to do what I want by dropping down >> to the attoparsec layer and messing with IResult. >> >> But is there a better way to do this? Would this be a good convenience >> routine to add to aeson in a PR? I.e. would anyone else use this? >> >> Thanks, >> -Ryan >> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >> > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexander.kjeldaas at gmail.com Sun May 29 21:27:50 2016 From: alexander.kjeldaas at gmail.com (Alexander Kjeldaas) Date: Sun, 29 May 2016 23:27:50 +0200 Subject: [Haskell-cafe] Mobile Development In-Reply-To: References: Message-ID: Depending on the domain of the application, I think all of those approaches are taking a suboptimal approach. Rather, I'd suggest you use the GHCJS backend and build on top of the React Native platform from Facebook. Alexander On Sat, May 28, 2016 at 12:29 PM, Henk-Jan van Tuyl wrote: > On Fri, 27 May 2016 14:42:37 +0200, Justin Wood > wrote: > > I'm wondering if anyone has any experience they can share, know of any blog >> posts or anything else documenting the use of Haskell when developing a >> mobile application. >> >> Ideally, I would like something along the lines of having a native UI, a >> language bridge, and use Haskell for the core logic. >> >> My main focus would be getting this to work on Android and iOS. If this >> would also work on Blackberry and Windows Phone it would be a plus. >> > : > > See: > - https://wiki.haskell.org/Android > - https://wiki.haskell.org/IPhone > > Regards, > Henk-Jan van Tuyl > > > -- > Folding at home > What if you could share your unused computer power to help find a cure? In > just 5 minutes you can join the world's biggest networked computer and get > us closer sooner. Watch the video. > http://folding.stanford.edu/ > > > http://Van.Tuyl.eu/ > http://members.chello.nl/hjgtuyl/tourdemonad.html > Haskell programming > -- > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rrnewton at gmail.com Sun May 29 21:53:33 2016 From: rrnewton at gmail.com (Ryan Newton) Date: Sun, 29 May 2016 17:53:33 -0400 Subject: [Haskell-cafe] JSON parser that returns the rest of the string that was not used In-Reply-To: <1464542615.25383.8.camel@installgentoo.com> References: <1464542615.25383.8.camel@installgentoo.com> Message-ID: Thanks, I'll have to try it and see if the Parser [Value] can enable streaming/incremental IO. On Sun, May 29, 2016 at 1:23 PM, Sanae wrote: > You could drop down to the attoparsec layer, but instead of messing with > IResults, use it to make another parser that will parse all the objects in > the file. > > E.g. json `sepBy` skipSpace :: Parser [Value] > > sepBy and skipSpace both taken from Data.Attoparsec.Text > > On Sun, 2016-05-29 at 13:09 -0400, Ryan Newton wrote: > > As someone who spent many years putting data in S-expression format, it > seems natural to me to write multiple S-expressions (or JSON objects) to a > file, and expect a reader to be able to read them back one at a time. > > This seems comparatively uncommon in the JSON world. Accordingly, it > looks like the most popular JSON parsing lib, Aeson, doesn't directly > provide this functionality. Functions like decode just return a "Maybe a", > not the left-over input, meaning that you would need to somehow split up > your multi-object file before attempting to parse, which is annoying and > error prone. > > It looks like maybe you can get Aeson to do what I want by dropping down > to the attoparsec layer and messing with IResult. > > But is there a better way to do this? Would this be a good convenience > routine to add to aeson in a PR? I.e. would anyone else use this? > > Thanks, > -Ryan > > > _______________________________________________ > Haskell-Cafe mailing listHaskell-Cafe at haskell.orghttp://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Mon May 30 00:18:08 2016 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Sun, 29 May 2016 17:18:08 -0700 Subject: [Haskell-cafe] JSON parser that returns the rest of the string that was not used In-Reply-To: References: <1464542615.25383.8.camel@installgentoo.com> Message-ID: Last spring some colleagues and I wrote a properly streaming Json parser that could incrementally emit Json primitive values as its fed bytestrings. There's some Corner cases that come up wrt how atto parsecs float parser parses 0.0 as two different zero literals depending on how it's split between chunks, but that aside its a pretty simple stack machine implementation that worked out pretty well On Sunday, May 29, 2016, Ryan Newton wrote: > Thanks, I'll have to try it and see if the Parser [Value] can enable > streaming/incremental IO. > > > On Sun, May 29, 2016 at 1:23 PM, Sanae > wrote: > >> You could drop down to the attoparsec layer, but instead of messing with >> IResults, use it to make another parser that will parse all the objects in >> the file. >> >> E.g. json `sepBy` skipSpace :: Parser [Value] >> >> sepBy and skipSpace both taken from Data.Attoparsec.Text >> >> On Sun, 2016-05-29 at 13:09 -0400, Ryan Newton wrote: >> >> As someone who spent many years putting data in S-expression format, it >> seems natural to me to write multiple S-expressions (or JSON objects) to a >> file, and expect a reader to be able to read them back one at a time. >> >> This seems comparatively uncommon in the JSON world. Accordingly, it >> looks like the most popular JSON parsing lib, Aeson, doesn't directly >> provide this functionality. Functions like decode just return a "Maybe a", >> not the left-over input, meaning that you would need to somehow split up >> your multi-object file before attempting to parse, which is annoying and >> error prone. >> >> It looks like maybe you can get Aeson to do what I want by dropping down >> to the attoparsec layer and messing with IResult. >> >> But is there a better way to do this? Would this be a good convenience >> routine to add to aeson in a PR? I.e. would anyone else use this? >> >> Thanks, >> -Ryan >> >> >> _______________________________________________ >> Haskell-Cafe mailing listHaskell-Cafe at haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> >> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rrnewton at gmail.com Mon May 30 00:52:35 2016 From: rrnewton at gmail.com (Ryan Newton) Date: Sun, 29 May 2016 20:52:35 -0400 Subject: [Haskell-cafe] JSON parser that returns the rest of the string that was not used In-Reply-To: References: Message-ID: On Sun, May 29, 2016 at 1:53 PM, Stephen Tetley wrote: > Isn't this a problem of JSON rather than it's parsers? > I can understand that a file with multiple JSONs is not a legal "JSON text". But... isn't that issue separate from whether parsers expect terminated strings, or, conversely, are tolerant of arbitrary text following the JSON expr? Scheme "read" functions from time immemorial would read the first expression off a handle without worrying about what followed it! It doesn't mean the whole file needs to be valid JSON, just that each prefix chewed off the front is valid JSON. Thanks to Nikita for the links to json-stream and json-incremental-decoder. My understanding is that if I use a top-level array to wrap the objects, then these approaches will let me retain a streaming/incremental IO. I'm not sure yet how to use this to stream output from a monadic computation. Let me be specific about the scenario I'm trying to handle: Criterion loops over benchmarks, and after running each, it writes the report out to disk appending it to a file: https://github.com/bos/criterion/blob/fb815c928af2cb089cea9399503304530e27883d/Criterion/Internal.hs#L128 This way, the report doesn't sit in memory affecting subsequent benchmarks. (I.e. polluting the live set for major GC.) When all benchmarks are complete, the reports are read back from the file. There are bugs in the binary serialization used in the linked code. We want to switch it to dump and read back in JSON instead. In this case, we can just write an initial "[" to the file, and then serialize one JSON object at a time, interspersed with ",". That's ok... but it's kind of an ugly solution -- it requires that, we, the client of the JSON serialization API, make assumptions about the serialization format and reimplement a tiny tiny fraction of it. Cheers, -Ryan On Sun, May 29, 2016 at 1:53 PM, Stephen Tetley wrote: > Hi Ryan > > Isn't this a problem of JSON rather than it's parsers? > > That's too say I believe (but could easily be wrong...) that a file > with multiple JSON objects would be ill-formed; it would be > well-formed if the multiple objects were in a single top-level array. > > On 29 May 2016 at 18:09, Ryan Newton wrote: > > As someone who spent many years putting data in S-expression format, it > > seems natural to me to write multiple S-expressions (or JSON objects) to > a > > file, and expect a reader to be able to read them back one at a time. > > > > This seems comparatively uncommon in the JSON world. Accordingly, it > looks > > like the most popular JSON parsing lib, Aeson, doesn't directly provide > this > > functionality. Functions like decode just return a "Maybe a", not the > > left-over input, meaning that you would need to somehow split up your > > multi-object file before attempting to parse, which is annoying and error > > prone. > > > > It looks like maybe you can get Aeson to do what I want by dropping down > to > > the attoparsec layer and messing with IResult. > > > > But is there a better way to do this? Would this be a good convenience > > routine to add to aeson in a PR? I.e. would anyone else use this? > > > > Thanks, > > -Ryan > > > > > > > > _______________________________________________ > > Haskell-Cafe mailing list > > Haskell-Cafe at haskell.org > > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ok at cs.otago.ac.nz Mon May 30 02:25:54 2016 From: ok at cs.otago.ac.nz (Richard A. O'Keefe) Date: Mon, 30 May 2016 14:25:54 +1200 Subject: [Haskell-cafe] JSON parser that returns the rest of the string that was not used In-Reply-To: References: Message-ID: <0043d002-c282-afa6-df63-e30d53600ba6@cs.otago.ac.nz> On 30/05/16 5:53 AM, Stephen Tetley wrote: > Hi Ryan > > Isn't this a problem of JSON rather than it's parsers? > > That's too say I believe (but could easily be wrong...) that a file > with multiple JSON objects would be ill-formed; it would be > well-formed if the multiple objects were in a single top-level array. "A file with multiple JSON objects would be ill-formed" -- it would be an ill-formed *what*? The media type application/json appears to describe a format containing precisely one JSON value, but RFC 7159 is otherwise silent about streams of JSON values. JSON is sometimes used as the format for entries in logs; it would be pretty useless for that if you couldn't have more than one in a sequence. If a JSON value is true, false, or null it ends at its last letter; if it's a string it ends at the closing double quote; if it's an array it ends at the closing ]; if it's an object it ends at the closing }; only if it is a number is there any need to check the next character, but then only one character needs to be checked, and thanks to the requirement that numbers be in ASCII, only one byte needs to be checked, there being no need to decode the next Unicode code point in full. From johannes.waldmann at htwk-leipzig.de Mon May 30 10:04:42 2016 From: johannes.waldmann at htwk-leipzig.de (Johannes Waldmann) Date: Mon, 30 May 2016 12:04:42 +0200 Subject: [Haskell-cafe] configurable mapping between data declarations and given XML schema? Message-ID: <1635a9f7-9389-8688-5ee8-cdbfc4d2681f@htwk-leipzig.de> Dear Cafe, I have a legacy XML schema, and some Haskell data declarations. I want to map bidirectionally between XML documents and data. I absolutely cannot change the schema. I could change the data declarations, but it would not help much, since I don't think there is any form of declaring data that would allow me to derive the transformations generically. So, I have a mess of ad-hoc transformations. What could be done about this? I think I need "generic with customization". More detail: https://github.com/jwaldmann/haskell-tpdb/issues/16 Comments appreciated. - J.W. From hesselink at gmail.com Mon May 30 10:53:05 2016 From: hesselink at gmail.com (Erik Hesselink) Date: Mon, 30 May 2016 12:53:05 +0200 Subject: [Haskell-cafe] configurable mapping between data declarations and given XML schema? In-Reply-To: <1635a9f7-9389-8688-5ee8-cdbfc4d2681f@htwk-leipzig.de> References: <1635a9f7-9389-8688-5ee8-cdbfc4d2681f@htwk-leipzig.de> Message-ID: Have you looked at the xml picklers from the hxt package [0]? They allow you to define matching parsers and printers from XML, which sounds exactly like your use case. You can define them manually, or derive (parts of) them using the generic-xmlpickler package [1]. Regards, Erik [0] http://hackage.haskell.org/package/hxt-9.3.1.15/docs/Text-XML-HXT-Arrow-Pickle.html [1] http://hackage.haskell.org/package/generic-xmlpickler On 30 May 2016 at 12:04, Johannes Waldmann wrote: > Dear Cafe, > > I have a legacy XML schema, and some Haskell data declarations. > I want to map bidirectionally between XML documents and data. > > I absolutely cannot change the schema. I could change the data > declarations, but it would not help much, since I don't think > there is any form of declaring data that would allow me > to derive the transformations generically. > > So, I have a mess of ad-hoc transformations. > What could be done about this? > I think I need "generic with customization". > > More detail: https://github.com/jwaldmann/haskell-tpdb/issues/16 > > Comments appreciated. > > - J.W. > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe From michaelburge at pobox.com Mon May 30 10:54:46 2016 From: michaelburge at pobox.com (Michael Burge) Date: Mon, 30 May 2016 03:54:46 -0700 Subject: [Haskell-cafe] configurable mapping between data declarations and given XML schema? In-Reply-To: <1635a9f7-9389-8688-5ee8-cdbfc4d2681f@htwk-leipzig.de> References: <1635a9f7-9389-8688-5ee8-cdbfc4d2681f@htwk-leipzig.de> Message-ID: You can try the XsdToHaskell tool in HaXml. It might not work perfectly by itself, but with a little cleanup it'll probably save you some time. I've also used TemplateHaskell to generate XML serializers for data declarations. If you write your own code generator, you can be as generic and customized as you need. On Mon, May 30, 2016 at 3:04 AM, Johannes Waldmann < johannes.waldmann at htwk-leipzig.de> wrote: > Dear Cafe, > > I have a legacy XML schema, and some Haskell data declarations. > I want to map bidirectionally between XML documents and data. > > I absolutely cannot change the schema. I could change the data > declarations, but it would not help much, since I don't think > there is any form of declaring data that would allow me > to derive the transformations generically. > > So, I have a mess of ad-hoc transformations. > What could be done about this? > I think I need "generic with customization". > > More detail: https://github.com/jwaldmann/haskell-tpdb/issues/16 > > Comments appreciated. > > - J.W. > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicola.gigante at gmail.com Mon May 30 11:20:43 2016 From: nicola.gigante at gmail.com (Nicola Gigante) Date: Mon, 30 May 2016 13:20:43 +0200 Subject: [Haskell-cafe] Quantum Programming EDSLs other than Quipper In-Reply-To: References: <96FCBE45-47DB-4573-995D-B32E7C58B9BB@gmail.com> Message-ID: > Il giorno 28 mag 2016, alle ore 21:25, Carter Schonwald ha scritto: > > https://github.com/NICTA/cogent/ is also a (very different!) linear logical language thats recently been made public by nicta, the associated papers on their projects are very illuminating. and either way, thers a lot of great theoretical and semi applied work intersecting with linear logical semantics thats ripe for use :) I?m sure a lot of work has been done on this front! I?m wondering how far all these things can be embedded in Haskell. Current dependent types extensions should allow to express linear types but I?m curious about how a specific extension to the type system would look. Who knows! Nicola -------------- next part -------------- An HTML attachment was scrubbed... URL: From rrnewton at gmail.com Mon May 30 13:16:42 2016 From: rrnewton at gmail.com (Ryan Newton) Date: Mon, 30 May 2016 09:16:42 -0400 Subject: [Haskell-cafe] JSON parser that returns the rest of the string that was not used In-Reply-To: <0043d002-c282-afa6-df63-e30d53600ba6@cs.otago.ac.nz> References: <0043d002-c282-afa6-df63-e30d53600ba6@cs.otago.ac.nz> Message-ID: Thanks Richard. I didn't know that the spec was precise about the JSON expr not going beyond the closing character. (I wasn't sure, for instance, if it would also include whitespace after that point.) For logging, I bet it helps if people try to enforce the invariant that JSON text doesn't internally include newlines... Best, -Ryan On Sun, May 29, 2016 at 10:25 PM, Richard A. O'Keefe wrote: > > > On 30/05/16 5:53 AM, Stephen Tetley wrote: > >> Hi Ryan >> >> Isn't this a problem of JSON rather than it's parsers? >> >> That's too say I believe (but could easily be wrong...) that a file >> with multiple JSON objects would be ill-formed; it would be >> well-formed if the multiple objects were in a single top-level array. >> > > "A file with multiple JSON objects would be ill-formed" -- it would be an > ill-formed *what*? > > The media type application/json appears to describe a format > containing precisely one JSON value, but RFC 7159 is otherwise silent > about streams of JSON values. > > JSON is sometimes used as the format for entries in logs; > it would be pretty useless for that if you couldn't have more than > one in a sequence. > > If a JSON value is true, false, or null it ends at its last letter; > if it's a string it ends at the closing double quote; > if it's an array it ends at the closing ]; > if it's an object it ends at the closing }; > only if it is a number is there any need to check the next > character, but then only one character needs to be checked, > and thanks to the requirement that numbers be in ASCII, only > one byte needs to be checked, there being no need to decode > the next Unicode code point in full. > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.feuer at gmail.com Tue May 31 00:13:41 2016 From: david.feuer at gmail.com (David Feuer) Date: Mon, 30 May 2016 20:13:41 -0400 Subject: [Haskell-cafe] Does the GHC GC handle const application? In-Reply-To: References: Message-ID: If I create a thunk representing const x y will the garbage collector be sure to replace this with x? I'm just wondering if I have to be concerned about the fact that Data.Sequence defines update in terms of adjust, with update x = adjust (const x) -------------- next part -------------- An HTML attachment was scrubbed... URL: From ok at cs.otago.ac.nz Tue May 31 00:42:13 2016 From: ok at cs.otago.ac.nz (Richard A. O'Keefe) Date: Tue, 31 May 2016 12:42:13 +1200 Subject: [Haskell-cafe] JSON parser that returns the rest of the string that was not used In-Reply-To: References: <0043d002-c282-afa6-df63-e30d53600ba6@cs.otago.ac.nz> Message-ID: <96a9e1d3-46cc-713f-622f-9e9969803877@cs.otago.ac.nz> On 31/05/16 1:16 AM, Ryan Newton wrote: > Thanks Richard. I didn't know that the spec was precise about the > JSON expr not going beyond the closing character. First, older versions of JSON required a value to be an object or an array. Second, the JSON grammar in RFC 7159 is quite precise. Insignificant whitespace is allowed before or after any of the six structural characters. -- That is, [ ] { } , : -- Oddly enough, the specification does NOT say that whitespace -- is allowed before or after any other token; it appears that -- "false" is legal at JSON top level but " false" is not. ws = *( %x20 / ; Space %x09 / ; Horizontal tab %x0A / ; Line feed or New line %x0D ) ; Carriage return value = false / null / true / object / array / number / string false = %x66.61.6c.73.65 ; false null = %x6e.75.6c.6c ; null true = %x74.72.75.65 ; true Note that it's not a matter of scanning a sequence of letters and then checking for particular values, it must be one of those three exact sequences. Once you have read the "e" of "false" there is no point in reading any further. You certainly don't need to skip white space, indeed, if you take the specification literally, you mustn't. (But, sigh, it IS ok to skip white space after a final ] or }. Such are the standards the net is made from.) object = ws %x7B ws [ member *( ws %x2C ws member ) ] ws %x7D ws member = string ws %x3A ws value array = ws %x5B ws [ value *( ws %x2C ws value ) ] ws %x5D ws And yes, the grammar is ambiguous. Consider "[ [ ] ]" Does the first white space character go with the first left bracket or the second one? All they needed to do was to say that strings, any other values, and , : ] } can be preceded by insignificant white space, and the ambiguity would be gone and " false" would be legal. Every kind of number ends with a block of digits; since white space isn't allowed after numbers, the next character, whatever it is, should not be consumed, but must be checked to make sure it is not a digit. I wonder if anyone has a JSON parser that follows the letter of the standard? Preparing this message has made me realise that (a) mine doesn't and (b) I don't really want it to. From erantapaa at gmail.com Tue May 31 01:52:50 2016 From: erantapaa at gmail.com (Erik Rantapaa) Date: Mon, 30 May 2016 18:52:50 -0700 (PDT) Subject: [Haskell-cafe] Is there any way to use somethig like global backtrack with parsec In-Reply-To: <8324cff3-086e-4801-97a4-39b77986e826@googlegroups.com> References: <8324cff3-086e-4801-97a4-39b77986e826@googlegroups.com> Message-ID: <5b638355-d791-4ff9-a0d9-55a426fcd414@googlegroups.com> If don't have to use Parsec, you can use a parser library like ReadP / ReadS. For example: import Text.ParserCombinators.ReadP abc = (choice [ string "a", string "ab" ] ) >> char 'c' >> eof run p s = case (readP_to_S p) s of [] -> Left "no parse" ((a,_):_) -> Right a test1 = run abc "ac" test2 = run abc "abc" test3 = run abc "ab" -- should fail On Monday, May 30, 2016 at 1:15:25 PM UTC-5, Petr Sokolov wrote: > > For example this parser doesn't parse "abc" > > test :: Parser String > test = ((try $ string "a") <|> (string "ab")) *> (string "c") > > I can rewrite it so it would parse "abc", but is there any general > approach to force parser to return and try other branches? > > (try a <|> b) *> c > > Something like > > (tryOtherBranchesIfFail (try a <|> b)) *> c > > So if it cannot parse "abc" with (try a *> c) it could return and try (b > *> c) > Or it isn't possible? > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk Tue May 31 07:20:30 2016 From: tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk (Tom Ellis) Date: Tue, 31 May 2016 08:20:30 +0100 Subject: [Haskell-cafe] Does the GHC GC handle const application? In-Reply-To: References: Message-ID: <20160531072030.GB968@weber> On Mon, May 30, 2016 at 08:13:41PM -0400, David Feuer wrote: > If I create a thunk representing > > const x y > > will the garbage collector be sure to replace this with x? Not until it's evaluated, no. > I'm just wondering if I have to be concerned about the fact that > Data.Sequence defines update in terms of adjust, with > > update x = adjust (const x) Could you say more about your concern? From david.feuer at gmail.com Tue May 31 11:48:28 2016 From: david.feuer at gmail.com (David Feuer) Date: Tue, 31 May 2016 07:48:28 -0400 Subject: [Haskell-cafe] Does the GHC GC handle const application? In-Reply-To: <20160531072030.GB968@weber> References: <20160531072030.GB968@weber> Message-ID: Currently, `adjust` is probably *too* lazy. When called, it places a thunk right at/below the root of the tree. This can lead to thunks building up around the root if multiple nodes are adjusted between inspections. I'm strongly considering modifying it to install its thunk at the appropriate leaf instead. Thinking about this, I realized that even with that modification, calling `update` multiple times on the same index could potentially lead to thunks building up around the leaf, even though this is never necessary. On May 31, 2016 3:20 AM, "Tom Ellis" < tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk> wrote: > On Mon, May 30, 2016 at 08:13:41PM -0400, David Feuer wrote: > > If I create a thunk representing > > > > const x y > > > > will the garbage collector be sure to replace this with x? > > Not until it's evaluated, no. > > > I'm just wondering if I have to be concerned about the fact that > > Data.Sequence defines update in terms of adjust, with > > > > update x = adjust (const x) > > Could you say more about your concern? > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From icfp.publicity at googlemail.com Tue May 31 22:02:37 2016 From: icfp.publicity at googlemail.com (Lindsey Kuper) Date: Tue, 31 May 2016 15:02:37 -0700 Subject: [Haskell-cafe] SIGPLAN Programming Languages Mentoring Workshop @ ICFP Message-ID: SIGPLAN Programming Languages Mentoring Workshop @ ICFP Nara, Japan (co-located with ICFP 2016) Sunday, September 18th, 2016 http://conf.researchr.org/track/icfp-2016/PLMW-ICFP-2016/ We are pleased to invite students interested in functional programming research to the programming languages mentoring workshop at ICFP. The goal of this workshop is to introduce senior undergraduate and early graduate students to research topics in functional programming as well as provide career mentoring advice. We have recruited leaders from the functional programming community to provide overviews of current research topics and give students valuable advice about how to thrive in graduate school, search for a job, and cultivate habits and skills that will help them in research careers. This workshop is part of the activities surrounding ICFP, the International Conference on Functional Programming, and takes place the day before the main conference. One goal of the workshop is to make the ICFP conference more accessible to newcomers and we hope participants will stay through the entire conference. Through the generous donation of our sponsors, we are able to provide travel scholarships to fund student participation. These travel scholarships will cover reasonable travel expenses (airfare and hotel) for attendance at both the workshop and the main three days of the ICFP conference. The workshop is open to all. Students with alternative sources of funding for their travel and registration fees are welcome. In particular, many student attendance programs provide full or partial travel funding for students to attend ICFP 2016, including the ACM Student Research Competition. More information about student attendance programs at ICFP is available: http://conf.researchr.org/home/icfp-2016 Application for Travel Support: The travel funding application is available from the PLMW webpage. The deadline for full consideration of funding is July 1st, 2016. Selected participants will be notified by July 15th. Organizers: Amal Ahmed, Northeastern University Robby Findler, Northwestern University Atsushi Igarashi, Kyoto University