-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the new format for the 102 codelab
- Loading branch information
1 parent
b273619
commit ffbb4b3
Showing
25 changed files
with
1,675 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Copyright 2021 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
.DEFAULT_GOAL := run | ||
.PHONY: repl run clean | ||
|
||
TARGET = codelab | ||
|
||
TOOL = .tool | ||
REPL = .repl_tool | ||
BUILD_GENERATED = dist dist-newstyle .stack-work stack.yaml.lock $(TOOL) $(REPL) | ||
|
||
repl: $(REPL) | ||
@`cat $(REPL)` :$(TARGET) | ||
|
||
run: $(TOOL) | ||
@`cat $(TOOL)` run $(TARGET) | ||
|
||
clean: | ||
@$(RM) -r $(BUILD_GENERATED) | ||
|
||
# | ||
# Private rules to check which toolchain is available | ||
# | ||
|
||
$(TOOL): | ||
@([[ -e `which stack` ]] && echo stack > $(TOOL) || true) | ||
@([[ -s $(TOOL) ]] || ([[ -e `which cabal` ]] && echo cabal > $(TOOL)) || true) | ||
@([[ -s $(TOOL) ]] || (cat setup.md && false)) | ||
|
||
$(REPL): | ||
@([[ -e `which stack` ]] && echo stack > $(TOOL) || true) | ||
@([[ -s $(REPL) ]] || ([[ -e `which cabal` ]] && echo cabal repl > $(REPL)) || true) | ||
@([[ -s $(REPL) ]] || (cat setup.md && false)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
-- Copyright 2021 Google LLC | ||
-- | ||
-- Licensed under the Apache License, Version 2.0 (the "License"); | ||
-- you may not use this file except in compliance with the License. | ||
-- You may obtain a copy of the License at | ||
-- | ||
-- https://www.apache.org/licenses/LICENSE-2.0 | ||
-- | ||
-- Unless required by applicable law or agreed to in writing, software | ||
-- distributed under the License is distributed on an "AS IS" BASIS, | ||
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
-- See the License for the specific language governing permissions and | ||
-- limitations under the License. | ||
|
||
import Distribution.Simple | ||
main = defaultMain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
-- Copyright 2021 Google LLC | ||
-- | ||
-- Licensed under the Apache License, Version 2.0 (the "License"); | ||
-- you may not use this file except in compliance with the License. | ||
-- You may obtain a copy of the License at | ||
-- | ||
-- https://www.apache.org/licenses/LICENSE-2.0 | ||
-- | ||
-- Unless required by applicable law or agreed to in writing, software | ||
-- distributed under the License is distributed on an "AS IS" BASIS, | ||
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
-- See the License for the specific language governing permissions and | ||
-- limitations under the License. | ||
|
||
name: codelab | ||
version: 0.1.0.0 | ||
build-type: Simple | ||
cabal-version: >=1.10 | ||
|
||
executable codelab | ||
hs-source-dirs: src | ||
default-language: Haskell2010 | ||
main-is: Main.hs | ||
build-depends: | ||
base >=4.11 && <4.15 | ||
|
||
executable solution | ||
hs-source-dirs: src | ||
default-language: Haskell2010 | ||
main-is: Main.hs | ||
build-depends: | ||
base >=4.11 && <4.15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
============================================ | ||
|
||
HASKELL 102 | ||
|
||
============================================ | ||
|
||
If you are reading this text, probably you don't have Haskell environment setup | ||
on your system. This should give you enough instructions to install it. | ||
|
||
First, note that there are two different ways to get Haskell installed: | ||
|
||
1. using [Stack](https://docs.haskellstack.org/en/stable/README/) | ||
2. getting the [Haskell Platform](https://www.haskell.org/platform/) | ||
|
||
This course is not taking any side, you are free to install either of these. The | ||
links above point to the install pages for either of the toolchains. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
-- Copyright 2021 Google LLC | ||
-- | ||
-- Licensed under the Apache License, Version 2.0 (the "License"); | ||
-- you may not use this file except in compliance with the License. | ||
-- You may obtain a copy of the License at | ||
-- | ||
-- https://www.apache.org/licenses/LICENSE-2.0 | ||
-- | ||
-- Unless required by applicable law or agreed to in writing, software | ||
-- distributed under the License is distributed on an "AS IS" BASIS, | ||
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
-- See the License for the specific language governing permissions and | ||
-- limitations under the License. | ||
|
||
module Main where | ||
|
||
main :: IO () | ||
main = do | ||
putStrLn "============================================" | ||
putStrLn "" | ||
putStrLn "Haskell toolchain is installed! All is good." | ||
putStrLn "" | ||
putStrLn "============================================" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright 2021 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
resolver: lts-14.25 | ||
packages: | ||
- . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Copyright 2021 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
.PHONY: run clean | ||
|
||
TARGET = codelab | ||
ARGS = solve | ||
|
||
TOOL = .tool | ||
BUILD_GENERATED = dist dist-newstyle .stack-work stack.yaml.lock $(TOOL) | ||
|
||
run: $(TOOL) | ||
@`cat $(TOOL)` run $(TARGET) $(ARGS) | ||
|
||
clean: | ||
@$(RM) -r $(BUILD_GENERATED) | ||
|
||
# | ||
# Private rules to check which toolchain is available | ||
# | ||
|
||
$(TOOL): | ||
@([[ -e `which stack` ]] && echo stack > $(TOOL) || true) | ||
@([[ -s $(TOOL) ]] || ([[ -e `which cabal` ]] && echo cabal > $(TOOL)) || true) | ||
@([[ -s $(TOOL) ]] || (cat setup.md && false)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
-- Copyright 2021 Google LLC | ||
-- | ||
-- Licensed under the Apache License, Version 2.0 (the "License"); | ||
-- you may not use this file except in compliance with the License. | ||
-- You may obtain a copy of the License at | ||
-- | ||
-- https://www.apache.org/licenses/LICENSE-2.0 | ||
-- | ||
-- Unless required by applicable law or agreed to in writing, software | ||
-- distributed under the License is distributed on an "AS IS" BASIS, | ||
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
-- See the License for the specific language governing permissions and | ||
-- limitations under the License. | ||
|
||
import Distribution.Simple | ||
main = defaultMain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
-- Copyright 2021 Google LLC | ||
-- | ||
-- Licensed under the Apache License, Version 2.0 (the "License"); | ||
-- you may not use this file except in compliance with the License. | ||
-- You may obtain a copy of the License at | ||
-- | ||
-- https://www.apache.org/licenses/LICENSE-2.0 | ||
-- | ||
-- Unless required by applicable law or agreed to in writing, software | ||
-- distributed under the License is distributed on an "AS IS" BASIS, | ||
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
-- See the License for the specific language governing permissions and | ||
-- limitations under the License. | ||
|
||
name: codelab | ||
version: 0.1.0.0 | ||
build-type: Simple | ||
cabal-version: >=1.10 | ||
|
||
executable codelab | ||
hs-source-dirs: src | ||
default-language: Haskell2010 | ||
main-is: Main.hs | ||
other-modules: | ||
Code | ||
, Color | ||
, ColorMap | ||
, Do | ||
, ErrorOr | ||
, Game | ||
, Internal | ||
, Tests | ||
build-depends: | ||
base >=4.11 && <4.15 | ||
, ansi-terminal >= 0.8.0.4 | ||
, containers >= 0.6.0.1 | ||
, optparse-applicative >= 0.14.3.0 | ||
, random >= 1.1 | ||
|
||
executable solution | ||
hs-source-dirs: src | ||
default-language: Haskell2010 | ||
main-is: Main.hs | ||
other-modules: | ||
CodeSolution | ||
, ColorSolution | ||
, ColorMapSolution | ||
, DoSolution | ||
, ErrorOrSolution | ||
, Game | ||
, Internal | ||
, Tests | ||
build-depends: | ||
base >=4.11 && <4.15 | ||
, ansi-terminal >= 0.8.0.4 | ||
, containers >= 0.6.0.1 | ||
, optparse-applicative >= 0.14.3.0 | ||
, random >= 1.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
============================================ | ||
|
||
HASKELL MTV 102 | ||
|
||
============================================ | ||
|
||
If you are reading this text, probably you don't have Haskell environment setup | ||
on your system. This should give you enough instructions to install it. | ||
|
||
First, note that there are two different ways to get Haskell installed: | ||
|
||
1. using [Stack](https://docs.haskellstack.org/en/stable/README/) | ||
2. getting the [Haskell Platform](https://www.haskell.org/platform/) | ||
|
||
This course is not taking any side, you are free to install either of these. The | ||
links above point to the install pages for either of the toolchains. |
Oops, something went wrong.