- Download codeworld api
cabal install codeworld-api
下载需要一段时间
下载好之后注意看下载的版本,因为在之后的 .cabal 文件中要指定 codeworld-api 的版本
2. 以下是 demo.cabal 示例
代码语言:javascript复制name: comp1100-lab04
version: 0.1.0
description: Drawing simple shapes with codeworld-api
homepage: https://cs.anu.edu.au/courses/comp1100
license: BSD3
license-file: LICENSE
author: Debashish Chakraborty, Joshua Corner, Tony Hosking
maintainer: debashish.chakraborty@anu.edu.au
copyright: 2020 The Australian National University
category: Education
build-type: Simple
cabal-version: >= 2.0
extra-source-files: lab04.md
source-repository head
type: git
location: https://gitlab.cecs.anu.edu.au/comp1100/Labs/Lab04.git
executable Main
hs-source-dirs: src
main-is: Main.hs
default-language: Haskell2010
other-modules: View, Model, Controlle
build-depends: base >= 4.11 && < 5
, codeworld-api >= 0.4 && < 0.8
, doctest
ghc-options: -Wall -threaded
注意codeworld-api >= 0.4 && < 0.8
这个范围要能够包括下载的版本
之后在项目所在的文件夹下本地运行 codeworld-api
代码语言:javascript复制cabal v2-run
成功运行后底部有链接,cmd 单击,在浏览器中打开(和 Jupyter Notebook 一样,如果没用过也没关系,就是在浏览器打开就OK了)