Skip to content

Commit e072be9

Browse files
committed
lab3: init
1 parent fb915ef commit e072be9

10 files changed

Lines changed: 274 additions & 0 deletions

File tree

lab-interpolation/LICENSE

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Copyright 2025 Author name here
2+
3+
Redistribution and use in source and binary forms, with or without
4+
modification, are permitted provided that the following conditions are met:
5+
6+
1. Redistributions of source code must retain the above copyright notice, this
7+
list of conditions and the following disclaimer.
8+
9+
2. Redistributions in binary form must reproduce the above copyright notice,
10+
this list of conditions and the following disclaimer in the documentation
11+
and/or other materials provided with the distribution.
12+
13+
3. Neither the name of the copyright holder nor the names of its contributors
14+
may be used to endorse or promote products derived from this software
15+
without specific prior written permission.
16+
17+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
21+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
24+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

lab-interpolation/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# lab-interpolation

lab-interpolation/Setup.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import Distribution.Simple
2+
main = defaultMain

lab-interpolation/app/Main.hs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module Main (main) where
2+
3+
import Lib
4+
5+
main :: IO ()
6+
main = someFunc
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
cabal-version: 2.2
2+
3+
-- This file has been generated from package.yaml by hpack version 0.37.0.
4+
--
5+
-- see: https://github.com/sol/hpack
6+
7+
name: lab-interpolation
8+
version: 0.1.0.0
9+
description: Please see the README on GitHub at <https://github.com/githubuser/lab-interpolation#readme>
10+
homepage: https://github.com/githubuser/lab-interpolation#readme
11+
bug-reports: https://github.com/githubuser/lab-interpolation/issues
12+
author: Author name here
13+
maintainer: example@example.com
14+
copyright: 2025 Author name here
15+
license: BSD-3-Clause
16+
license-file: LICENSE
17+
build-type: Simple
18+
extra-source-files:
19+
README.md
20+
CHANGELOG.md
21+
22+
source-repository head
23+
type: git
24+
location: https://github.com/githubuser/lab-interpolation
25+
26+
library
27+
exposed-modules:
28+
Lib
29+
other-modules:
30+
Paths_lab_interpolation
31+
autogen-modules:
32+
Paths_lab_interpolation
33+
hs-source-dirs:
34+
src
35+
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints
36+
build-depends:
37+
base >=4.7 && <5
38+
default-language: Haskell2010
39+
40+
executable lab-interpolation-exe
41+
main-is: Main.hs
42+
other-modules:
43+
Paths_lab_interpolation
44+
autogen-modules:
45+
Paths_lab_interpolation
46+
hs-source-dirs:
47+
app
48+
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N
49+
build-depends:
50+
base >=4.7 && <5
51+
, lab-interpolation
52+
default-language: Haskell2010
53+
54+
test-suite lab-interpolation-test
55+
type: exitcode-stdio-1.0
56+
main-is: Spec.hs
57+
other-modules:
58+
Paths_lab_interpolation
59+
autogen-modules:
60+
Paths_lab_interpolation
61+
hs-source-dirs:
62+
test
63+
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N
64+
build-depends:
65+
base >=4.7 && <5
66+
, lab-interpolation
67+
default-language: Haskell2010

lab-interpolation/package.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: lab-interpolation
2+
version: 0.1.0.0
3+
github: "githubuser/lab-interpolation"
4+
license: BSD-3-Clause
5+
author: "Author name here"
6+
maintainer: "example@example.com"
7+
copyright: "2025 Author name here"
8+
9+
extra-source-files:
10+
- README.md
11+
- CHANGELOG.md
12+
13+
# Metadata used when publishing your package
14+
# synopsis: Short description of your package
15+
# category: Web
16+
17+
# To avoid duplicated efforts in documentation and dealing with the
18+
# complications of embedding Haddock markup inside cabal files, it is
19+
# common to point users to the README.md file.
20+
description: Please see the README on GitHub at <https://github.com/githubuser/lab-interpolation#readme>
21+
22+
dependencies:
23+
- base >= 4.7 && < 5
24+
25+
ghc-options:
26+
- -Wall
27+
- -Wcompat
28+
- -Widentities
29+
- -Wincomplete-record-updates
30+
- -Wincomplete-uni-patterns
31+
- -Wmissing-export-lists
32+
- -Wmissing-home-modules
33+
- -Wpartial-fields
34+
- -Wredundant-constraints
35+
36+
library:
37+
source-dirs: src
38+
39+
executables:
40+
lab-interpolation-exe:
41+
main: Main.hs
42+
source-dirs: app
43+
ghc-options:
44+
- -threaded
45+
- -rtsopts
46+
- -with-rtsopts=-N
47+
dependencies:
48+
- lab-interpolation
49+
50+
tests:
51+
lab-interpolation-test:
52+
main: Spec.hs
53+
source-dirs: test
54+
ghc-options:
55+
- -threaded
56+
- -rtsopts
57+
- -with-rtsopts=-N
58+
dependencies:
59+
- lab-interpolation

lab-interpolation/src/Lib.hs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
module Lib where
2+
3+
someFunc :: IO ()
4+
someFunc = putStrLn "someFunc"
5+
6+
7+
readDot = do
8+
putStr "Enter x y: "
9+
xy <- getLine
10+
return xy
11+
12+
extractNumbers :: String -> (Float, Float)
13+
extractNumbers xy = (read x, read y)
14+
where
15+
lst = words xy
16+
x = head lst
17+
y = head $ tail lst
18+
19+
20+
hw = do
21+
putStrLn "What is your name?"
22+
name <- getLine
23+
if name == ""
24+
then hw
25+
else putStrLn $ "Hello, " ++ name ++ "!"
26+
27+
28+
putStr' :: String -> IO ()
29+
putStr' "" = return ()
30+
putStr' (c:cs) = putChar c >> putStr' cs
31+

lab-interpolation/stack.yaml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# This file was automatically generated by 'stack init'
2+
#
3+
# Some commonly used options have been documented as comments in this file.
4+
# For advanced use and comprehensive documentation of the format, please see:
5+
# https://docs.haskellstack.org/en/stable/yaml_configuration/
6+
7+
# A 'specific' Stackage snapshot or a compiler version.
8+
# A snapshot resolver dictates the compiler version and the set of packages
9+
# to be used for project dependencies. For example:
10+
#
11+
# snapshot: lts-22.28
12+
# snapshot: nightly-2024-07-05
13+
# snapshot: ghc-9.6.6
14+
#
15+
# The location of a snapshot can be provided as a file or url. Stack assumes
16+
# a snapshot provided as a file might change, whereas a url resource does not.
17+
#
18+
# snapshot: ./custom-snapshot.yaml
19+
# snapshot: https://example.com/snapshots/2024-01-01.yaml
20+
snapshot:
21+
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/23/4.yaml
22+
23+
# User packages to be built.
24+
# Various formats can be used as shown in the example below.
25+
#
26+
# packages:
27+
# - some-directory
28+
# - https://example.com/foo/bar/baz-0.0.2.tar.gz
29+
# subdirs:
30+
# - auto-update
31+
# - wai
32+
packages:
33+
- .
34+
# Dependency packages to be pulled from upstream that are not in the snapshot.
35+
# These entries can reference officially published versions as well as
36+
# forks / in-progress versions pinned to a git hash. For example:
37+
#
38+
# extra-deps:
39+
# - acme-missiles-0.3
40+
# - git: https://github.com/commercialhaskell/stack.git
41+
# commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a
42+
#
43+
# extra-deps: []
44+
45+
# Override default flag values for project packages and extra-deps
46+
# flags: {}
47+
48+
# Extra package databases containing global packages
49+
# extra-package-dbs: []
50+
51+
# Control whether we use the GHC we find on the path
52+
# system-ghc: true
53+
#
54+
# Require a specific version of Stack, using version ranges
55+
# require-stack-version: -any # Default
56+
# require-stack-version: ">=3.1"
57+
#
58+
# Override the architecture used by Stack, especially useful on Windows
59+
# arch: i386
60+
# arch: x86_64
61+
#
62+
# Extra directories used by Stack for building
63+
# extra-include-dirs: [/path/to/dir]
64+
# extra-lib-dirs: [/path/to/dir]
65+
#
66+
# Allow a newer minor version of GHC than the snapshot specifies
67+
# compiler-check: newer-minor

lab-interpolation/stack.yaml.lock

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# This file was autogenerated by Stack.
2+
# You should not edit this file by hand.
3+
# For more information, please see the documentation at:
4+
# https://docs.haskellstack.org/en/stable/lock_files
5+
6+
packages: []
7+
snapshots:
8+
- completed:
9+
sha256: 0d61fd2be255f5c425cd92dbb4a78d1f70af2c138f3ec921e98b97ae182b044c
10+
size: 679291
11+
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/23/4.yaml
12+
original:
13+
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/23/4.yaml

lab-interpolation/test/Spec.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
main :: IO ()
2+
main = putStrLn "Test suite not yet implemented"

0 commit comments

Comments
 (0)