用 Haskell 的 list comprehension 來解某數學愛好者社團的某題目。
執行結果
$ ghc -o solution solution.hs && ./solution
[[D,A,D,B,B,D,C,C,D,C]]| function delay(ms = 1000) { | |
| return new Promise((resolve) => { | |
| setTimeout(resolve, ms); | |
| }); | |
| } | |
| function getCourseIdFromPath() { | |
| try { | |
| const [, id] = window.location.hash.match(/course-wizard\/edit\/([^/]+)/); | |
| return id; |
| Error: The application encountered the following error: uninitialized constant Bundler::Settings (NameError) | |
| /nix/store/li2vmpp6mxqzrs6s95szj1xga380hsv4-sample-rails-app-dev-bundler-env/lib/ruby/gems/2.5.0/gems/bundler-1.17.3/lib/bundler/settings.rb:6:in `<module:Bundler>' | |
| /nix/store/li2vmpp6mxqzrs6s95szj1xga380hsv4-sample-rails-app-dev-bundler-env/lib/ruby/gems/2.5.0/gems/bundler-1.17.3/lib/bundler/settings.rb:5:in `<top (required)>' | |
| /nix/store/928i2cf1wizgm7dapmnk0m8ijrsjdj43-ruby-2.5.7/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:72:in `require' | |
| /nix/store/928i2cf1wizgm7dapmnk0m8ijrsjdj43-ruby-2.5.7/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:72:in `require' | |
| /nix/store/li2vmpp6mxqzrs6s95szj1xga380hsv4-sample-rails-app-dev-bundler-env/lib/ruby/gems/2.5.0/gems/bundler-1.17.3/lib/bundler.rb:273:in `settings' | |
| /nix/store/li2vmpp6mxqzrs6s95szj1xga380hsv4-sample-rails-app-dev-bundler-env/lib/ruby/gems/2.5.0/gems/bundler-1.17.3/lib/bundler.rb:84:in `configured_bundle_path' | |
| const appMachine = Machine({ | |
| id: 'app', | |
| initial: 'unauthenticated', | |
| states: { | |
| unauthenticated: { | |
| on: { | |
| LOGIN: 'authenticated', | |
| }, | |
| }, | |
| authenticated: { |
| /** | |
| * telegraf-keyboard-bot | |
| * | |
| * Function to execute: handleRequest | |
| * | |
| * Required environment variables: | |
| * | |
| * - TELEGRAM_BOT_AUTHENTICATION_TOKEN | |
| * | |
| * Run |
| const citizenQuartzMultiAlarmIIIMachine = Machine({ | |
| id: 'citizen-quartz-multi-alarm-iii', | |
| initial: 'displays', | |
| states: { | |
| 'displays': { | |
| initial: 'time', | |
| states: { | |
| 'time': { | |
| on: { |
| // Available variables: | |
| // - Machine | |
| // - interpret | |
| // - assign | |
| // - send | |
| // - sendParent | |
| // - spawn | |
| // - raise | |
| // - actions |
| ################### APM Server Configuration ######################### | |
| ############################# APM Server ###################################### | |
| apm-server: | |
| # Defines the host and port the server is listening on. use "unix:/path/to.sock" to listen on a unix domain socket. | |
| host: "localhost:8200" | |
| # Maximum permitted size in bytes of a request's header accepted by the server to be processed. | |
| #max_header_size: 1048576 |
用 Haskell 的 list comprehension 來解某數學愛好者社團的某題目。
$ ghc -o solution solution.hs && ./solution
[[D,A,D,B,B,D,C,C,D,C]]