trackler 2.0.0.3 → 2.0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (154) hide show
  1. checksums.yaml +4 -4
  2. data/common/CONTRIBUTING.md +1 -1
  3. data/common/README.md +4 -4
  4. data/common/exercises/bowling/canonical-data.json +8 -0
  5. data/common/exercises/hello-world/description.md +1 -1
  6. data/lib/trackler/version.rb +1 -1
  7. data/tracks/c/.gitignore +1 -0
  8. data/tracks/c/bin/run-tests +3 -0
  9. data/tracks/c/config.json +9 -0
  10. data/tracks/c/exercises/clock/makefile +16 -0
  11. data/tracks/c/exercises/clock/src/clock.h +11 -0
  12. data/tracks/c/exercises/clock/src/example.c +31 -0
  13. data/tracks/c/exercises/clock/test/test_clock.c +489 -0
  14. data/tracks/c/exercises/clock/test/vendor/unity.c +1300 -0
  15. data/tracks/c/exercises/clock/test/vendor/unity.h +274 -0
  16. data/tracks/c/exercises/clock/test/vendor/unity_internals.h +701 -0
  17. data/tracks/coldfusion/config.json +2 -1
  18. data/tracks/coldfusion/img/icon.png +0 -0
  19. data/tracks/crystal/Makefile +11 -15
  20. data/tracks/crystal/SETUP.md +1 -1
  21. data/tracks/crystal/docs/LEARNING.md +5 -3
  22. data/tracks/crystal/docs/TESTS.md +24 -3
  23. data/tracks/crystal/exercises/anagram/{anagram_spec.cr → spec/anagram_spec.cr} +1 -1
  24. data/tracks/crystal/exercises/anagram/{example.cr → src/example.cr} +0 -0
  25. data/tracks/crystal/exercises/atbash-cipher/{atbash_cipher_spec.cr → spec/atbash_cipher_spec.cr} +1 -1
  26. data/tracks/crystal/exercises/atbash-cipher/{example.cr → src/example.cr} +0 -0
  27. data/tracks/crystal/exercises/bob/{bob_spec.cr → spec/bob_spec.cr} +1 -1
  28. data/tracks/crystal/exercises/bob/{example.cr → src/example.cr} +0 -0
  29. data/tracks/crystal/exercises/bracket-push/{bracket_push_spec.cr → spec/bracket_push_spec.cr} +1 -1
  30. data/tracks/crystal/exercises/bracket-push/{example.cr → src/example.cr} +0 -0
  31. data/tracks/crystal/exercises/gigasecond/{gigasecond_spec.cr → spec/gigasecond_spec.cr} +1 -1
  32. data/tracks/crystal/exercises/gigasecond/{example.cr → src/example.cr} +0 -0
  33. data/tracks/crystal/exercises/hamming/{hamming_spec.cr → spec/hamming_spec.cr} +1 -1
  34. data/tracks/crystal/exercises/hamming/{example.cr → src/example.cr} +0 -0
  35. data/tracks/crystal/exercises/hello-world/HINTS.md +32 -0
  36. data/tracks/crystal/exercises/hello-world/{hello_world_spec.cr → spec/hello_world_spec.cr} +1 -1
  37. data/tracks/crystal/exercises/hello-world/{example.cr → src/example.cr} +0 -0
  38. data/tracks/crystal/exercises/largest-series-product/{largest_series_product_spec.cr → spec/largest_series_product_spec.cr} +1 -1
  39. data/tracks/crystal/exercises/largest-series-product/{example.cr → src/example.cr} +0 -0
  40. data/tracks/crystal/exercises/leap/{leap_spec.cr → spec/leap_spec.cr} +1 -1
  41. data/tracks/crystal/exercises/leap/{example.cr → src/example.cr} +0 -0
  42. data/tracks/crystal/exercises/pangram/{pangram_spec.cr → spec/pangram_spec.cr} +1 -1
  43. data/tracks/crystal/exercises/pangram/{example.cr → src/example.cr} +0 -0
  44. data/tracks/crystal/exercises/raindrops/{raindrops_spec.cr → spec/raindrops_spec.cr} +1 -1
  45. data/tracks/crystal/exercises/raindrops/{example.cr → src/example.cr} +0 -0
  46. data/tracks/crystal/exercises/react/{react_spec.cr → spec/react_spec.cr} +1 -1
  47. data/tracks/crystal/exercises/react/{example.cr → src/example.cr} +0 -0
  48. data/tracks/crystal/exercises/rna-transcription/{rna_transcription_spec.cr → spec/rna_transcription_spec.cr} +1 -1
  49. data/tracks/crystal/exercises/rna-transcription/{example.cr → src/example.cr} +0 -0
  50. data/tracks/crystal/exercises/roman-numerals/{roman_numerals_spec.cr → spec/roman_numerals_spec.cr} +1 -1
  51. data/tracks/crystal/exercises/roman-numerals/{example.cr → src/example.cr} +0 -0
  52. data/tracks/crystal/exercises/sieve/{sieve_spec.cr → spec/sieve_spec.cr} +1 -1
  53. data/tracks/crystal/exercises/sieve/{example.cr → src/example.cr} +0 -0
  54. data/tracks/haskell/.travis.yml +4 -2
  55. data/tracks/haskell/config.json +6 -6
  56. data/tracks/haskell/exercises/alphametics/package.yaml +0 -1
  57. data/tracks/haskell/exercises/atbash-cipher/package.yaml +0 -1
  58. data/tracks/haskell/exercises/bank-account/package.yaml +0 -1
  59. data/tracks/haskell/exercises/binary-search-tree/HINTS.md +3 -2
  60. data/tracks/haskell/exercises/binary-search-tree/src/BST.hs +2 -0
  61. data/tracks/haskell/exercises/change/test/Tests.hs +2 -1
  62. data/tracks/haskell/exercises/connect/package.yaml +0 -1
  63. data/tracks/haskell/exercises/crypto-square/package.yaml +0 -1
  64. data/tracks/haskell/exercises/custom-set/HINTS.md +3 -2
  65. data/tracks/haskell/exercises/custom-set/src/CustomSet.hs +3 -2
  66. data/tracks/haskell/exercises/food-chain/package.yaml +0 -1
  67. data/tracks/haskell/exercises/forth/HINTS.md +3 -2
  68. data/tracks/haskell/exercises/forth/src/Forth.hs +2 -0
  69. data/tracks/haskell/exercises/go-counting/package.yaml +0 -1
  70. data/tracks/haskell/exercises/grade-school/package.yaml +0 -1
  71. data/tracks/haskell/exercises/grains/src/Grains.hs +3 -1
  72. data/tracks/haskell/exercises/kindergarten-garden/package.yaml +0 -1
  73. data/tracks/haskell/exercises/largest-series-product/package.yaml +0 -1
  74. data/tracks/haskell/exercises/lens-person/package.yaml +0 -1
  75. data/tracks/haskell/exercises/linked-list/package.yaml +0 -1
  76. data/tracks/haskell/exercises/ocr-numbers/package.yaml +0 -2
  77. data/tracks/haskell/exercises/parallel-letter-frequency/package.yaml +0 -1
  78. data/tracks/haskell/exercises/rna-transcription/package.yaml +0 -1
  79. data/tracks/haskell/exercises/robot-name/package.yaml +0 -1
  80. data/tracks/haskell/exercises/saddle-points/package.yaml +0 -1
  81. data/tracks/haskell/exercises/say/package.yaml +0 -1
  82. data/tracks/haskell/exercises/scrabble-score/package.yaml +0 -1
  83. data/tracks/haskell/exercises/series/HINTS.md +23 -0
  84. data/tracks/haskell/exercises/series/examples/success-byteseqs/package.yaml +19 -0
  85. data/tracks/haskell/exercises/series/examples/success-byteseqs/src/Series.hs +26 -0
  86. data/tracks/haskell/exercises/series/src/Series.hs +2 -1
  87. data/tracks/haskell/exercises/series/test/Tests.hs +16 -11
  88. data/tracks/haskell/exercises/sgf-parsing/package.yaml +0 -1
  89. data/tracks/haskell/exercises/sieve/package.yaml +0 -1
  90. data/tracks/haskell/exercises/simple-cipher/package.yaml +0 -1
  91. data/tracks/haskell/exercises/triangle/package.yaml +0 -1
  92. data/tracks/haskell/exercises/word-count/examples/success-newtype/src/WordCount.hs +7 -4
  93. data/tracks/haskell/exercises/word-count/examples/success-simple/src/WordCount.hs +6 -2
  94. data/tracks/haskell/exercises/word-count/test/Tests.hs +30 -1
  95. data/tracks/haskell/exercises/wordy/package.yaml +0 -2
  96. data/tracks/java/docs/INSTALLATION.md +2 -0
  97. data/tracks/java/exercises/_template/build.gradle +1 -1
  98. data/tracks/java/exercises/accumulate/build.gradle +1 -1
  99. data/tracks/java/exercises/acronym/build.gradle +1 -1
  100. data/tracks/java/exercises/allergies/build.gradle +1 -1
  101. data/tracks/java/exercises/anagram/build.gradle +1 -1
  102. data/tracks/java/exercises/atbash-cipher/build.gradle +1 -1
  103. data/tracks/java/exercises/beer-song/build.gradle +1 -1
  104. data/tracks/java/exercises/binary/build.gradle +1 -1
  105. data/tracks/java/exercises/bob/build.gradle +1 -1
  106. data/tracks/java/exercises/crypto-square/build.gradle +1 -1
  107. data/tracks/java/exercises/etl/build.gradle +1 -1
  108. data/tracks/java/exercises/gigasecond/build.gradle +1 -1
  109. data/tracks/java/exercises/grade-school/build.gradle +1 -1
  110. data/tracks/java/exercises/hamming/build.gradle +1 -1
  111. data/tracks/java/exercises/hello-world/build.gradle +1 -1
  112. data/tracks/java/exercises/hexadecimal/build.gradle +1 -1
  113. data/tracks/java/exercises/linked-list/build.gradle +1 -1
  114. data/tracks/java/exercises/luhn/build.gradle +1 -1
  115. data/tracks/java/exercises/meetup/build.gradle +1 -1
  116. data/tracks/java/exercises/nth-prime/build.gradle +1 -1
  117. data/tracks/java/exercises/nucleotide-count/build.gradle +1 -1
  118. data/tracks/java/exercises/octal/build.gradle +1 -1
  119. data/tracks/java/exercises/pangram/build.gradle +1 -1
  120. data/tracks/java/exercises/pascals-triangle/build.gradle +1 -1
  121. data/tracks/java/exercises/phone-number/build.gradle +1 -1
  122. data/tracks/java/exercises/pig-latin/build.gradle +1 -1
  123. data/tracks/java/exercises/raindrops/build.gradle +1 -1
  124. data/tracks/java/exercises/rna-transcription/build.gradle +1 -1
  125. data/tracks/java/exercises/robot-name/build.gradle +1 -1
  126. data/tracks/java/exercises/roman-numerals/build.gradle +1 -1
  127. data/tracks/java/exercises/scrabble-score/build.gradle +1 -1
  128. data/tracks/java/exercises/sieve/build.gradle +1 -1
  129. data/tracks/java/exercises/simple-cipher/build.gradle +1 -1
  130. data/tracks/java/exercises/simple-linked-list/build.gradle +1 -1
  131. data/tracks/java/exercises/space-age/build.gradle +1 -1
  132. data/tracks/java/exercises/strain/build.gradle +1 -1
  133. data/tracks/java/exercises/triangle/build.gradle +1 -1
  134. data/tracks/java/exercises/trinary/build.gradle +1 -1
  135. data/tracks/java/exercises/word-count/build.gradle +1 -1
  136. data/tracks/ocaml/.travis-ci.sh +1 -1
  137. data/tracks/ocaml/.travis.yml +1 -1
  138. data/tracks/ocaml/README.md +1 -1
  139. data/tracks/ocaml/exercises/hamming/hamming.mli +1 -3
  140. data/tracks/ruby/exercises/leap/.version +1 -1
  141. data/tracks/ruby/exercises/leap/example.tt +3 -3
  142. data/tracks/ruby/exercises/leap/leap_test.rb +3 -4
  143. data/tracks/ruby/lib/leap_cases.rb +2 -2
  144. data/tracks/rust/exercises/bowling/tests/bowling.rs +29 -0
  145. data/tracks/swift/.gitignore +1 -0
  146. data/tracks/swift/.swift-version +1 -0
  147. data/tracks/swift/exercises/bowling/BowlingExample.swift +2 -2
  148. data/tracks/swift/exercises/bowling/BowlingTest.swift +84 -94
  149. data/tracks/swift/exercises/palindrome-products/PalindromeProductsExample.swift +19 -16
  150. data/tracks/tcl/README.md +3 -0
  151. data/tracks/tcl/config.json +2 -1
  152. data/tracks/tcl/img/icon.png +0 -0
  153. metadata +46 -33
  154. data/tracks/crystal/exercises/hello-world/GETTING_STARTED.md +0 -10
@@ -8,7 +8,8 @@
8
8
 
9
9
  ],
10
10
  "ignored": [
11
- "bin"
11
+ "bin",
12
+ "img"
12
13
  ],
13
14
  "foregone": [
14
15
 
Binary file
@@ -1,28 +1,24 @@
1
- # assignments
2
1
  ASSIGNMENT ?= ""
3
- IGNOREDIRS := "^(\.git|docs)$$"
2
+ IGNOREDIRS := "^(\.git|.crystal|docs|bin|img|script)$$"
4
3
  EXERCISESDIR ?= "exercises"
5
4
  ASSIGNMENTS = $(shell find exercises -maxdepth 1 -mindepth 1 -type d | cut -d'/' -f2 | sort | grep -Ev $(IGNOREDIRS))
6
5
 
7
- # output directories
8
- TMPDIR ?= "/tmp"
9
- OUTDIR := $(shell mktemp -d "$(TMPDIR)/$(ASSIGNMENT).XXXXXXXXXX")
10
-
11
- # language specific config (tweakable per language)
12
6
  FILEEXT := "cr"
13
- EXAMPLE := "example.$(FILEEXT)"
14
- TESTNAME := "$(subst -,_,$(ASSIGNMENT))"
15
- SPECFILE := "$(TESTNAME)_spec.$(FILEEXT)"
16
- TESTFILE := "$(TESTNAME).$(FILEEXT)"
7
+ SPECDIR = "spec"
8
+ ASSIGNMENTNAME := "$(subst -,_,$(ASSIGNMENT))"
9
+ EXERCISESPECDIR := $(EXERCISESDIR)/$(ASSIGNMENT)/$(SPECDIR)
10
+ SPECFILE := "$(ASSIGNMENTNAME)_spec.$(FILEEXT)"
11
+ TMPSPECFILE := "$(ASSIGNMENTNAME)_spec.$(FILEEXT).tmp"
17
12
 
18
13
  test-assignment:
19
14
  @echo "running formatting check for: $(ASSIGNMENT)"
20
15
  @crystal tool format --check $(EXERCISESDIR)/$(ASSIGNMENT)
16
+ @echo "moving files around"
17
+ @sed 's/pending/it/g' $(EXERCISESPECDIR)/$(SPECFILE) > $(EXERCISESPECDIR)/$(TMPSPECFILE)
18
+ @rm $(EXERCISESPECDIR)/$(SPECFILE)
19
+ @mv $(EXERCISESPECDIR)/$(TMPSPECFILE) $(EXERCISESPECDIR)/$(SPECFILE)
21
20
  @echo "running tests for: $(ASSIGNMENT)"
22
- @cp $(EXERCISESDIR)/$(ASSIGNMENT)/$(SPECFILE) $(OUTDIR)
23
- @cp $(EXERCISESDIR)/$(ASSIGNMENT)/$(EXAMPLE) $(OUTDIR)/$(TESTFILE)
24
- @sed 's/pending/it/g' $(EXERCISESDIR)/$(ASSIGNMENT)/$(SPECFILE) > $(OUTDIR)/$(SPECFILE)
25
- @cd $(OUTDIR) && crystal spec $(SPECFILE)
21
+ @cd $(EXERCISESDIR)/$(ASSIGNMENT) && crystal spec
26
22
  @printf "\n"
27
23
 
28
24
  test:
@@ -13,7 +13,7 @@ http://crystal-lang.org/docs/installation/index.html
13
13
  Execute the tests with:
14
14
 
15
15
  ```bash
16
- $ crystal spec test_spec.cr
16
+ $ crystal spec
17
17
  ```
18
18
 
19
19
  In each test suite all but the first test have been skipped.
@@ -1,7 +1,9 @@
1
1
  ## Learning Crystal
2
2
 
3
- * [Crystal Official Docs](https://crystal-lang.org/docs/): This is the go-tolearning resource for Crystal at the moment. And they are pretty exhaustive, right from the basic literals and variables to some advanced stuff like macros. They also have a neat [doc on coding conventions](https://crystal-lang.org/docs/conventions/index.html).
4
-
5
- * Crystal Playground - While Crystal doesn't have a REPL (like Ruby, Python or Node), it does have a way to somewhat easily experiment with code. Just run `crystal play` and you should have a place to play around with Crystal in your browser at localhost:8080.
3
+ * [Crystal Official Docs](https://crystal-lang.org/docs/): This is the go-to learning resource for Crystal at the moment. And they are pretty exhaustive, right from the basic literals and variables to some advanced stuff like macros. They also have a neat [doc on coding conventions](https://crystal-lang.org/docs/conventions/index.html).
6
4
 
7
5
  * [Crystal for Rubyists](http://www.crystalforrubyists.com/): A practical intro to Crystal language.
6
+
7
+ * Crystal Playground - While Crystal doesn't have a built-in REPL (like Ruby, Python or Node), it does have a way to somewhat easily experiment with code. Just run `crystal play` and you should have a place to play around with Crystal in your browser at localhost:8080.
8
+
9
+ * Crystal REPL Add-on - A GitHub user has created a REPL of sorts for Crystal. It's called [ICR](https://github.com/greyblake/crystal-icr) (a nod to Ruby's IRB). As most things in Crystal, it's still in a nascent phase and might be prone to bugs.
@@ -1,12 +1,25 @@
1
1
  ## Running Tests
2
2
 
3
- Execute the tests with:
3
+ When you are in the directory for an exercise, you should see two subdirectories:
4
+
5
+ * `src` contains your solution to the exercise
6
+ * `spec` contains the tests to run for the exercise
7
+
8
+ If you're in the right directory (i.e. the one containing `src` and `spec`), you can run the tests for that exercise by running `crystal spec`:
4
9
 
5
10
  ```bash
6
- $ crystal spec test_spec.cr
11
+ $ pwd
12
+ /Users/johndoe/Code/exercism/crystal/hello-world
13
+
14
+ $ ls
15
+ GETTING_STARTED.md README.md spec src
16
+
17
+ $ crystal spec
7
18
  ```
8
19
 
9
- In each test suite all but the first test have been skipped.
20
+ This will run all of the test files in the `spec` directory.
21
+
22
+ In each test file, all but the first test have been skipped.
10
23
 
11
24
  Once you get a test passing, you can unskip the next one by changing `pending` to `it`.
12
25
 
@@ -25,3 +38,11 @@ Or you can selectively format files with:
25
38
  ```bash
26
39
  $ crystal tool format ./<path>/<to>/<file>
27
40
  ```
41
+
42
+ ## Submitting Your Solution
43
+
44
+ Be sure to submit the source file in the `src` directory when submitting your solution:
45
+
46
+ ```bash
47
+ $ exercism submit src/<exercise>.cr
48
+ ```
@@ -1,5 +1,5 @@
1
1
  require "spec"
2
- require "./anagram"
2
+ require "../src/*"
3
3
 
4
4
  describe "Anagram" do
5
5
  describe "#find" do
@@ -1,5 +1,5 @@
1
1
  require "spec"
2
- require "./atbash_cipher"
2
+ require "../src/*"
3
3
 
4
4
  describe "Atbash" do
5
5
  describe "#encode" do
@@ -1,5 +1,5 @@
1
1
  require "spec"
2
- require "./bob"
2
+ require "../src/*"
3
3
 
4
4
  describe "Bob" do
5
5
  describe "#hey" do
@@ -1,5 +1,5 @@
1
1
  require "spec"
2
- require "./bracket_push"
2
+ require "../src/*"
3
3
 
4
4
  describe "Brackets" do
5
5
  describe "#are_valid?" do
@@ -1,5 +1,5 @@
1
1
  require "spec"
2
- require "./gigasecond"
2
+ require "../src/*"
3
3
 
4
4
  describe "Gigasecond" do
5
5
  describe "#from" do
@@ -1,5 +1,5 @@
1
1
  require "spec"
2
- require "./hamming"
2
+ require "../src/*"
3
3
 
4
4
  describe "Hamming" do
5
5
  describe "#compute" do
@@ -0,0 +1,32 @@
1
+ ## Project Structure
2
+
3
+ * `src` contains your solution to the exercise
4
+ * `spec` contains the tests to run for the exercise
5
+
6
+ ## Running Tests
7
+
8
+ If you're in the right directory (i.e. the one containing `src` and `spec`), you can run the tests for that exercise by running `crystal spec`:
9
+
10
+ ```bash
11
+ $ pwd
12
+ /Users/johndoe/Code/exercism/crystal/hello-world
13
+
14
+ $ ls
15
+ GETTING_STARTED.md README.md spec src
16
+
17
+ $ crystal spec
18
+ ```
19
+
20
+ This will run all of the test files in the `spec` directory.
21
+
22
+ In each test file, all but the first test have been skipped.
23
+
24
+ Once you get a test passing, you can unskip the next one by changing `pending` to `it`.
25
+
26
+ ## Submitting Your Solution
27
+
28
+ Be sure to submit the source file in the `src` directory when submitting your solution:
29
+
30
+ ```bash
31
+ $ exercism submit src/hello_world.cr
32
+ ```
@@ -1,5 +1,5 @@
1
1
  require "spec"
2
- require "./hello_world"
2
+ require "../src/*"
3
3
 
4
4
  describe "HelloWorld" do
5
5
  describe "#hello" do
@@ -1,5 +1,5 @@
1
1
  require "spec"
2
- require "./largest_series_product"
2
+ require "../src/*"
3
3
 
4
4
  describe "Series" do
5
5
  describe "#largest_product" do
@@ -1,5 +1,5 @@
1
1
  require "spec"
2
- require "./leap"
2
+ require "../src/*"
3
3
 
4
4
  struct Time
5
5
  def leap_year?
@@ -1,5 +1,5 @@
1
1
  require "spec"
2
- require "./pangram"
2
+ require "../src/*"
3
3
 
4
4
  describe "Pangram" do
5
5
  describe "#pangram?" do
@@ -1,5 +1,5 @@
1
1
  require "spec"
2
- require "./raindrops"
2
+ require "../src/*"
3
3
 
4
4
  describe "Raindrops" do
5
5
  describe "#drops" do
@@ -1,5 +1,5 @@
1
1
  require "spec"
2
- require "./react"
2
+ require "../src/*"
3
3
 
4
4
  describe React::InputCell do
5
5
  it "have a value" do
@@ -1,5 +1,5 @@
1
1
  require "spec"
2
- require "./rna_transcription"
2
+ require "../src/*"
3
3
 
4
4
  describe "RnaComplement" do
5
5
  describe "#of_dna" do
@@ -1,5 +1,5 @@
1
1
  require "spec"
2
- require "./roman_numerals"
2
+ require "../src/*"
3
3
 
4
4
  describe "Int" do
5
5
  describe "#to_roman" do
@@ -1,5 +1,5 @@
1
1
  require "spec"
2
- require "./sieve"
2
+ require "../src/*"
3
3
 
4
4
  describe "Primes" do
5
5
  describe "#sieve" do
@@ -58,8 +58,10 @@ script:
58
58
  else
59
59
  for example in examples/*/ ; do
60
60
  examplename=$(basename "$example")
61
- mkdir -p "${HOME}/.foldercache/${exercise}/${examplename}/.stack-work"
62
- ln -f -s "${HOME}/.foldercache/${exercise}/${examplename}/.stack-work"
61
+ exercisename=$(basename "$exercise")
62
+ examplecache="${HOME}/.foldercache/${exercisename}/${examplename}/.stack-work"
63
+ mkdir -p "$examplecache"
64
+ ln -f -s "$examplecache"
63
65
 
64
66
  echo "testing ${example}"
65
67
  rm -f src/*.hs
@@ -148,12 +148,6 @@
148
148
  "topics": [
149
149
  ]
150
150
  },
151
- {
152
- "slug": "word-count",
153
- "difficulty": 4,
154
- "topics": [
155
- ]
156
- },
157
151
  {
158
152
  "slug": "meetup",
159
153
  "difficulty": 4,
@@ -256,6 +250,12 @@
256
250
  "topics": [
257
251
  ]
258
252
  },
253
+ {
254
+ "slug": "word-count",
255
+ "difficulty": 5,
256
+ "topics": [
257
+ ]
258
+ },
259
259
  {
260
260
  "slug": "binary-search-tree",
261
261
  "difficulty": 5,
@@ -9,7 +9,6 @@ library:
9
9
  dependencies:
10
10
  # - foo # List here the packages you
11
11
  # - bar # want to use in your solution.
12
- - parsec
13
12
 
14
13
  tests:
15
14
  test:
@@ -9,7 +9,6 @@ library:
9
9
  dependencies:
10
10
  # - foo # List here the packages you
11
11
  # - bar # want to use in your solution.
12
- - split
13
12
 
14
13
  tests:
15
14
  test:
@@ -9,7 +9,6 @@ library:
9
9
  dependencies:
10
10
  # - foo # List here the packages you
11
11
  # - bar # want to use in your solution.
12
- - stm
13
12
 
14
13
  tests:
15
14
  test:
@@ -12,5 +12,6 @@ with `Eq` and `Show` instances, and implement the functions:
12
12
  - `singleton`
13
13
  - `toList`
14
14
 
15
- You will find the type signatures already in place, but it is up to you
16
- to define the functions.
15
+ You will find a dummy data declaration and type signatures already in place,
16
+ but it is up to you to define the functions and create a meaningful data type,
17
+ newtype or type synonym.
@@ -10,6 +10,8 @@ module BST
10
10
  , toList
11
11
  ) where
12
12
 
13
+ data BST a = Dummy deriving (Eq, Show)
14
+
13
15
  bstLeft :: BST a -> Maybe (BST a)
14
16
  bstLeft = undefined
15
17
 
@@ -1,6 +1,7 @@
1
1
  {-# LANGUAGE RecordWildCards #-}
2
2
 
3
3
  import Data.Foldable (for_)
4
+ import Data.List (sort)
4
5
  import Test.Hspec (Spec, describe, it, shouldBe)
5
6
  import Test.Hspec.Runner (configFastFail, defaultConfig, hspecWith)
6
7
 
@@ -17,7 +18,7 @@ specs = describe "Change" $
17
18
  test Case{..} = it description assertion
18
19
  where
19
20
  assertion = expression `shouldBe` expected
20
- expression = findFewestCoins target coins
21
+ expression = sort <$> findFewestCoins target coins
21
22
 
22
23
  -- Test cases adapted from `exercism/x-common` on 2016-09-17.
23
24
 
@@ -9,7 +9,6 @@ library:
9
9
  dependencies:
10
10
  # - foo # List here the packages you
11
11
  # - bar # want to use in your solution.
12
- - array
13
12
 
14
13
  tests:
15
14
  test:
@@ -9,7 +9,6 @@ library:
9
9
  dependencies:
10
10
  # - foo # List here the packages you
11
11
  # - bar # want to use in your solution.
12
- - split
13
12
 
14
13
  tests:
15
14
  test:
@@ -17,8 +17,9 @@ with `Eq` and `Show` instances, and implement the following functions:
17
17
  - `toList`
18
18
  - `union`
19
19
 
20
- You will find the type signatures already in place, but it is up to you
21
- to define the functions.
20
+ You will find a dummy data declaration and type signatures already in place,
21
+ but it is up to you to define the functions and create a meaningful data type,
22
+ newtype or type synonym.
22
23
 
23
24
  If you're interested in writing an efficient implementation but don't quite
24
25
  know where to start, the best primer I know of is Chris Okasaki's
@@ -1,6 +1,5 @@
1
1
  module CustomSet
2
- ( CustomSet
3
- , delete
2
+ ( delete
4
3
  , difference
5
4
  , empty
6
5
  , fromList
@@ -17,6 +16,8 @@ module CustomSet
17
16
 
18
17
  import Prelude hiding (null)
19
18
 
19
+ data CustomSet a = Dummy deriving (Eq, Show)
20
+
20
21
  delete :: a -> CustomSet a -> CustomSet a
21
22
  delete = undefined
22
23
 
@@ -9,7 +9,6 @@ library:
9
9
  dependencies:
10
10
  # - foo # List here the packages you
11
11
  # - bar # want to use in your solution.
12
- - array
13
12
 
14
13
  tests:
15
14
  test:
@@ -8,5 +8,6 @@ and implement the following functions:
8
8
  - `toList` returns the current stack as a list, with the element on top
9
9
  of the stack being the rightmost (last) element.
10
10
 
11
- You will find the type signatures already in place, but it is up to you
12
- to define the functions.
11
+ You will find a dummy data declaration and type signatures already in place,
12
+ but it is up to you to define the functions and create a meaningful data type,
13
+ newtype or type synonym.
@@ -17,6 +17,8 @@ data ForthError
17
17
  | UnknownWord Text
18
18
  deriving (Show, Eq)
19
19
 
20
+ data ForthState = Dummy
21
+
20
22
  empty :: ForthState
21
23
  empty = undefined
22
24
 
@@ -10,7 +10,6 @@ library:
10
10
  dependencies:
11
11
  # - foo # List here the packages you
12
12
  # - bar # want to use in your solution.
13
- - array
14
13
 
15
14
  tests:
16
15
  test:
@@ -9,7 +9,6 @@ library:
9
9
  dependencies:
10
10
  # - foo # List here the packages you
11
11
  # - bar # want to use in your solution.
12
- - containers
13
12
 
14
13
  tests:
15
14
  test:
@@ -1,5 +1,7 @@
1
1
  module Grains (square, total) where
2
2
 
3
- square = undefined
3
+ square :: Integer -> Maybe Integer
4
+ square n = undefined
4
5
 
6
+ total :: Integer
5
7
  total = undefined
@@ -10,7 +10,6 @@ library:
10
10
  # - foo # List here the packages you
11
11
  # - bar # want to use in your solution.
12
12
  - containers
13
- - split
14
13
 
15
14
  tests:
16
15
  test:
@@ -9,7 +9,6 @@ library:
9
9
  dependencies:
10
10
  # - foo # List here the packages you
11
11
  # - bar # want to use in your solution.
12
- - safe
13
12
 
14
13
  tests:
15
14
  test:
@@ -10,7 +10,6 @@ library:
10
10
  dependencies:
11
11
  # - foo # List here the packages you
12
12
  # - bar # want to use in your solution.
13
- - lens
14
13
 
15
14
  tests:
16
15
  test:
@@ -9,7 +9,6 @@ library:
9
9
  dependencies:
10
10
  # - foo # List here the packages you
11
11
  # - bar # want to use in your solution.
12
- - stm
13
12
 
14
13
  tests:
15
14
  test:
@@ -9,8 +9,6 @@ library:
9
9
  dependencies:
10
10
  # - foo # List here the packages you
11
11
  # - bar # want to use in your solution.
12
- - containers
13
- - split
14
12
 
15
13
  tests:
16
14
  test:
@@ -11,7 +11,6 @@ library:
11
11
  dependencies:
12
12
  # - foo # List here the packages you
13
13
  # - bar # want to use in your solution.
14
- - parallel
15
14
 
16
15
  tests:
17
16
  test:
@@ -9,7 +9,6 @@ library:
9
9
  dependencies:
10
10
  # - foo # List here the packages you
11
11
  # - bar # want to use in your solution.
12
- - containers
13
12
 
14
13
  tests:
15
14
  test:
@@ -9,7 +9,6 @@ library:
9
9
  dependencies:
10
10
  # - foo # List here the packages you
11
11
  # - bar # want to use in your solution.
12
- - random
13
12
 
14
13
  tests:
15
14
  test:
@@ -10,7 +10,6 @@ library:
10
10
  dependencies:
11
11
  # - foo # List here the packages you
12
12
  # - bar # want to use in your solution.
13
- - containers
14
13
 
15
14
  tests:
16
15
  test:
@@ -9,7 +9,6 @@ library:
9
9
  dependencies:
10
10
  # - foo # List here the packages you
11
11
  # - bar # want to use in your solution.
12
- - array
13
12
 
14
13
  tests:
15
14
  test:
@@ -9,7 +9,6 @@ library:
9
9
  dependencies:
10
10
  # - foo # List here the packages you
11
11
  # - bar # want to use in your solution.
12
- - containers
13
12
 
14
13
  tests:
15
14
  test: