Skip to content

Commit 2dae2c7

Browse files
authored
Update Prelude references (#317)
1 parent d287f02 commit 2dae2c7

File tree

1 file changed

+35
-35
lines changed

1 file changed

+35
-35
lines changed

src/Dhall/Tutorial.hs

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -474,12 +474,12 @@ import Dhall
474474
--
475475
-- __Exercise:__ There is a @not@ function hosted online here:
476476
--
477-
-- <https://ipfs.io/ipfs/QmQ8w5PLcsNz56dMvRtq54vbuPe9cNnCCUXAQp6xLc6Ccx/Prelude/Bool/not>
477+
-- <https://ipfs.io/ipfs/QmdtKd5Q7tebdo6rXfZed4kN6DXmErRQHJ4PsNCtca9GbB/Prelude/Bool/not>
478478
--
479479
-- Visit that link and read the documentation. Then try to guess what this
480480
-- code returns:
481481
--
482-
-- > >>> input auto "https://ipfs.io/ipfs/QmQ8w5PLcsNz56dMvRtq54vbuPe9cNnCCUXAQp6xLc6Ccx/Prelude/Bool/not https://ipfs.io/ipfs/QmVf6hhTCXc9y2pRvhUmLk3AZYEgjeAz5PNwjt1GBYqsVB" :: IO Bool
482+
-- > >>> input auto "https://ipfs.io/ipfs/QmdtKd5Q7tebdo6rXfZed4kN6DXmErRQHJ4PsNCtca9GbB/Prelude/Bool/not https://ipfs.io/ipfs/QmVf6hhTCXc9y2pRvhUmLk3AZYEgjeAz5PNwjt1GBYqsVB" :: IO Bool
483483
-- > ???
484484
--
485485
-- Run the code to test your guess
@@ -966,7 +966,7 @@ import Dhall
966966
-- You can also use @let@ expressions to rename imports, like this:
967967
--
968968
-- > $ dhall
969-
-- > let not = https://ipfs.io/ipfs/QmQ8w5PLcsNz56dMvRtq54vbuPe9cNnCCUXAQp6xLc6Ccx/Prelude/Bool/not
969+
-- > let not = https://ipfs.io/ipfs/QmdtKd5Q7tebdo6rXfZed4kN6DXmErRQHJ4PsNCtca9GbB/Prelude/Bool/not
970970
-- > in not True
971971
-- > <Ctrl-D>
972972
-- > Bool
@@ -1324,7 +1324,7 @@ import Dhall
13241324
-- complex example:
13251325
--
13261326
-- > $ dhall
1327-
-- > let Prelude/List/map = https://ipfs.io/ipfs/QmQ8w5PLcsNz56dMvRtq54vbuPe9cNnCCUXAQp6xLc6Ccx/Prelude/List/map
1327+
-- > let Prelude/List/map = https://ipfs.io/ipfs/QmdtKd5Q7tebdo6rXfZed4kN6DXmErRQHJ4PsNCtca9GbB/Prelude/List/map
13281328
-- > in λ(f : Integer → Integer) → Prelude/List/map Integer Integer f [1, 2, 3]
13291329
-- > <Ctrl-D>
13301330
-- > ∀(f : Integer → Integer) → List Integer
@@ -1348,11 +1348,11 @@ import Dhall
13481348
-- __Exercise__: The Dhall Prelude provides a @replicate@ function which you can
13491349
-- find here:
13501350
--
1351-
-- <https://ipfs.io/ipfs/QmQ8w5PLcsNz56dMvRtq54vbuPe9cNnCCUXAQp6xLc6Ccx/Prelude/List/replicate>
1351+
-- <https://ipfs.io/ipfs/QmdtKd5Q7tebdo6rXfZed4kN6DXmErRQHJ4PsNCtca9GbB/Prelude/List/replicate>
13521352
--
13531353
-- Test what the following Dhall expression normalizes to:
13541354
--
1355-
-- > let replicate = https://ipfs.io/ipfs/QmQ8w5PLcsNz56dMvRtq54vbuPe9cNnCCUXAQp6xLc6Ccx/Prelude/List/replicate
1355+
-- > let replicate = https://ipfs.io/ipfs/QmdtKd5Q7tebdo6rXfZed4kN6DXmErRQHJ4PsNCtca9GbB/Prelude/List/replicate
13561356
-- > in replicate +10
13571357
--
13581358
-- __Exercise__: If you have a lot of spare time, try to \"break the compiler\" by
@@ -1604,11 +1604,11 @@ import Dhall
16041604
-- normalizing them:
16051605
--
16061606
-- > $ dhall-format
1607-
-- > let replicate = https://ipfs.io/ipfs/QmQ8w5PLcsNz56dMvRtq54vbuPe9cNnCCUXAQp6xLc6Ccx/Prelude/List/replicate
1607+
-- > let replicate = https://ipfs.io/ipfs/QmdtKd5Q7tebdo6rXfZed4kN6DXmErRQHJ4PsNCtca9GbB/Prelude/List/replicate
16081608
-- > in replicate +5 (List (List Integer)) (replicate +5 (List Integer) (replicate +5 Integer 1))
16091609
-- > <Ctrl-D>
16101610
-- > let replicate =
1611-
-- > https://ipfs.io/ipfs/QmQ8w5PLcsNz56dMvRtq54vbuPe9cNnCCUXAQp6xLc6Ccx/Prelude/List/replicate
1611+
-- > https://ipfs.io/ipfs/QmdtKd5Q7tebdo6rXfZed4kN6DXmErRQHJ4PsNCtca9GbB/Prelude/List/replicate
16121612
-- >
16131613
-- > in replicate
16141614
-- > +5
@@ -1619,7 +1619,7 @@ import Dhall
16191619
-- @--pretty@ flag of the @dhall@ executable:
16201620
--
16211621
-- > $ dhall --pretty
1622-
-- > let replicate = https://ipfs.io/ipfs/QmQ8w5PLcsNz56dMvRtq54vbuPe9cNnCCUXAQp6xLc6Ccx/Prelude/List/replicate
1622+
-- > let replicate = https://ipfs.io/ipfs/QmdtKd5Q7tebdo6rXfZed4kN6DXmErRQHJ4PsNCtca9GbB/Prelude/List/replicate
16231623
-- > in replicate +5 (List (List Integer)) (replicate +5 (List Integer) (replicate +5 Integer 1))
16241624
-- > <Ctrl-D>
16251625
-- > List (List (List Integer))
@@ -2283,7 +2283,7 @@ import Dhall
22832283
--
22842284
-- Rules:
22852285
--
2286-
-- > let Prelude/List/concat = https://ipfs.io/ipfs/QmQ8w5PLcsNz56dMvRtq54vbuPe9cNnCCUXAQp6xLc6Ccx/Prelude/List/concat
2286+
-- > let Prelude/List/concat = https://ipfs.io/ipfs/QmdtKd5Q7tebdo6rXfZed4kN6DXmErRQHJ4PsNCtca9GbB/Prelude/List/concat
22872287
-- >
22882288
-- > List/fold a (Prelude/List/concat a xss) b c
22892289
-- > = List/fold (List a) xss b (λ(x : List a) → List/fold a x b c)
@@ -2352,10 +2352,10 @@ import Dhall
23522352
--
23532353
-- Rules:
23542354
--
2355-
-- > let Prelude/Optional/head = https://ipfs.io/ipfs/QmQ8w5PLcsNz56dMvRtq54vbuPe9cNnCCUXAQp6xLc6Ccx/Prelude/Optional/head
2356-
-- > let Prelude/List/concat = https://ipfs.io/ipfs/QmQ8w5PLcsNz56dMvRtq54vbuPe9cNnCCUXAQp6xLc6Ccx/Prelude/List/concat
2357-
-- > let Prelude/List/concatMap = https://ipfs.io/ipfs/QmQ8w5PLcsNz56dMvRtq54vbuPe9cNnCCUXAQp6xLc6Ccx/Prelude/List/concatMap
2358-
-- > let Prelude/List/map = https://ipfs.io/ipfs/QmQ8w5PLcsNz56dMvRtq54vbuPe9cNnCCUXAQp6xLc6Ccx/Prelude/List/map
2355+
-- > let Prelude/Optional/head = https://ipfs.io/ipfs/QmdtKd5Q7tebdo6rXfZed4kN6DXmErRQHJ4PsNCtca9GbB/Prelude/Optional/head
2356+
-- > let Prelude/List/concat = https://ipfs.io/ipfs/QmdtKd5Q7tebdo6rXfZed4kN6DXmErRQHJ4PsNCtca9GbB/Prelude/List/concat
2357+
-- > let Prelude/List/concatMap = https://ipfs.io/ipfs/QmdtKd5Q7tebdo6rXfZed4kN6DXmErRQHJ4PsNCtca9GbB/Prelude/List/concatMap
2358+
-- > let Prelude/List/map = https://ipfs.io/ipfs/QmdtKd5Q7tebdo6rXfZed4kN6DXmErRQHJ4PsNCtca9GbB/Prelude/List/map
23592359
-- >
23602360
-- > List/head a (Prelude/List/concat a xss) =
23612361
-- > Prelude/Optional/head a (Prelude/List/map (List a) (Optional a) (List/head a) xss)
@@ -2383,10 +2383,10 @@ import Dhall
23832383
--
23842384
-- Rules:
23852385
--
2386-
-- > let Prelude/Optional/last = https://ipfs.io/ipfs/QmQ8w5PLcsNz56dMvRtq54vbuPe9cNnCCUXAQp6xLc6Ccx/Prelude/Optional/last
2387-
-- > let Prelude/List/concat = https://ipfs.io/ipfs/QmQ8w5PLcsNz56dMvRtq54vbuPe9cNnCCUXAQp6xLc6Ccx/Prelude/List/concat
2388-
-- > let Prelude/List/concatMap = https://ipfs.io/ipfs/QmQ8w5PLcsNz56dMvRtq54vbuPe9cNnCCUXAQp6xLc6Ccx/Prelude/List/concatMap
2389-
-- > let Prelude/List/map = https://ipfs.io/ipfs/QmQ8w5PLcsNz56dMvRtq54vbuPe9cNnCCUXAQp6xLc6Ccx/Prelude/List/map
2386+
-- > let Prelude/Optional/last = https://ipfs.io/ipfs/QmdtKd5Q7tebdo6rXfZed4kN6DXmErRQHJ4PsNCtca9GbB/Prelude/Optional/last
2387+
-- > let Prelude/List/concat = https://ipfs.io/ipfs/QmdtKd5Q7tebdo6rXfZed4kN6DXmErRQHJ4PsNCtca9GbB/Prelude/List/concat
2388+
-- > let Prelude/List/concatMap = https://ipfs.io/ipfs/QmdtKd5Q7tebdo6rXfZed4kN6DXmErRQHJ4PsNCtca9GbB/Prelude/List/concatMap
2389+
-- > let Prelude/List/map = https://ipfs.io/ipfs/QmdtKd5Q7tebdo6rXfZed4kN6DXmErRQHJ4PsNCtca9GbB/Prelude/List/map
23902390
-- >
23912391
-- > List/last a (Prelude/List/concat a xss) =
23922392
-- > Prelude/Optional/last a (Prelude/List/map (List a) (Optional a) (List/last a) xss)
@@ -2414,9 +2414,9 @@ import Dhall
24142414
--
24152415
-- Rules:
24162416
--
2417-
-- > let Prelude/List/shifted = https://ipfs.io/ipfs/QmQ8w5PLcsNz56dMvRtq54vbuPe9cNnCCUXAQp6xLc6Ccx/Prelude/List/shifted
2418-
-- > let Prelude/List/concat = https://ipfs.io/ipfs/QmQ8w5PLcsNz56dMvRtq54vbuPe9cNnCCUXAQp6xLc6Ccx/Prelude/List/concat
2419-
-- > let Prelude/List/map = https://ipfs.io/ipfs/QmQ8w5PLcsNz56dMvRtq54vbuPe9cNnCCUXAQp6xLc6Ccx/Prelude/List/map
2417+
-- > let Prelude/List/shifted = https://ipfs.io/ipfs/QmdtKd5Q7tebdo6rXfZed4kN6DXmErRQHJ4PsNCtca9GbB/Prelude/List/shifted
2418+
-- > let Prelude/List/concat = https://ipfs.io/ipfs/QmdtKd5Q7tebdo6rXfZed4kN6DXmErRQHJ4PsNCtca9GbB/Prelude/List/concat
2419+
-- > let Prelude/List/map = https://ipfs.io/ipfs/QmdtKd5Q7tebdo6rXfZed4kN6DXmErRQHJ4PsNCtca9GbB/Prelude/List/map
24202420
-- >
24212421
-- > List/indexed a (Prelude/List/concat a xss) =
24222422
-- > Prelude/List/shifted a (Prelude/List/map (List a) (List { index : Natural, value : a }) (List/indexed a) xss)
@@ -2439,9 +2439,9 @@ import Dhall
24392439
--
24402440
-- Rules:
24412441
--
2442-
-- > let Prelude/List/map = https://ipfs.io/ipfs/QmQ8w5PLcsNz56dMvRtq54vbuPe9cNnCCUXAQp6xLc6Ccx/Prelude/List/map
2443-
-- > let Prelude/List/concat = https://ipfs.io/ipfs/QmQ8w5PLcsNz56dMvRtq54vbuPe9cNnCCUXAQp6xLc6Ccx/Prelude/List/concat
2444-
-- > let Prelude/List/concatMap = https://ipfs.io/ipfs/QmQ8w5PLcsNz56dMvRtq54vbuPe9cNnCCUXAQp6xLc6Ccx/Prelude/List/concatMap
2442+
-- > let Prelude/List/map = https://ipfs.io/ipfs/QmdtKd5Q7tebdo6rXfZed4kN6DXmErRQHJ4PsNCtca9GbB/Prelude/List/map
2443+
-- > let Prelude/List/concat = https://ipfs.io/ipfs/QmdtKd5Q7tebdo6rXfZed4kN6DXmErRQHJ4PsNCtca9GbB/Prelude/List/concat
2444+
-- > let Prelude/List/concatMap = https://ipfs.io/ipfs/QmdtKd5Q7tebdo6rXfZed4kN6DXmErRQHJ4PsNCtca9GbB/Prelude/List/concatMap
24452445
-- >
24462446
-- > List/reverse a (Prelude/List/concat a xss)
24472447
-- > = Prelude/List/concat a (List/reverse (List a) (Prelude/List/map (List a) (List a) (List/reverse a) xss))
@@ -2499,7 +2499,7 @@ import Dhall
24992499
--
25002500
-- ... which currenty redirects to:
25012501
--
2502-
-- <https://ipfs.io/ipfs/QmQ8w5PLcsNz56dMvRtq54vbuPe9cNnCCUXAQp6xLc6Ccx/Prelude>
2502+
-- <https://ipfs.io/ipfs/QmdtKd5Q7tebdo6rXfZed4kN6DXmErRQHJ4PsNCtca9GbB/Prelude>
25032503
--
25042504
-- There is nothing \"official\" or \"standard\" about this Prelude other than
25052505
-- the fact that it is mentioned in this tutorial. The \"Prelude\" is just a
@@ -2510,12 +2510,12 @@ import Dhall
25102510
-- subdirectories. For example, the @Bool@ subdirectory has a @not@ file
25112511
-- located here:
25122512
--
2513-
-- <https://ipfs.io/ipfs/QmQ8w5PLcsNz56dMvRtq54vbuPe9cNnCCUXAQp6xLc6Ccx/Prelude/Bool/not>
2513+
-- <https://ipfs.io/ipfs/QmdtKd5Q7tebdo6rXfZed4kN6DXmErRQHJ4PsNCtca9GbB/Prelude/Bool/not>
25142514
--
25152515
-- The @not@ function is just a UTF8-encoded text file hosted online with the
25162516
-- following contents
25172517
--
2518-
-- > $ curl https://ipfs.io/ipfs/QmQ8w5PLcsNz56dMvRtq54vbuPe9cNnCCUXAQp6xLc6Ccx/Prelude/Bool/not
2518+
-- > $ curl https://ipfs.io/ipfs/QmdtKd5Q7tebdo6rXfZed4kN6DXmErRQHJ4PsNCtca9GbB/Prelude/Bool/not
25192519
-- > {-
25202520
-- > Flip the value of a `Bool`
25212521
-- >
@@ -2548,7 +2548,7 @@ import Dhall
25482548
-- You can use this @not@ function either directly:
25492549
--
25502550
-- > $ dhall
2551-
-- > https://ipfs.io/ipfs/QmQ8w5PLcsNz56dMvRtq54vbuPe9cNnCCUXAQp6xLc6Ccx/Prelude/Bool/not True
2551+
-- > https://ipfs.io/ipfs/QmdtKd5Q7tebdo6rXfZed4kN6DXmErRQHJ4PsNCtca9GbB/Prelude/Bool/not True
25522552
-- > <Ctrl-D>
25532553
-- > Bool
25542554
-- >
@@ -2557,7 +2557,7 @@ import Dhall
25572557
-- ... or assign the URL to a shorter name:
25582558
--
25592559
-- > $ dhall
2560-
-- > let Bool/not = https://ipfs.io/ipfs/QmQ8w5PLcsNz56dMvRtq54vbuPe9cNnCCUXAQp6xLc6Ccx/Prelude/Bool/not
2560+
-- > let Bool/not = https://ipfs.io/ipfs/QmdtKd5Q7tebdo6rXfZed4kN6DXmErRQHJ4PsNCtca9GbB/Prelude/Bool/not
25612561
-- > in Bool/not True
25622562
-- > <Ctrl-D>
25632563
-- > Bool
@@ -2568,7 +2568,7 @@ import Dhall
25682568
-- consistency and documentation, such as @Prelude\/Natural\/even@, which
25692569
-- re-exports the built-in @Natural/even@ function:
25702570
--
2571-
-- > $ curl https://ipfs.io/ipfs/QmQ8w5PLcsNz56dMvRtq54vbuPe9cNnCCUXAQp6xLc6Ccx/Prelude/Natural/even
2571+
-- > $ curl https://ipfs.io/ipfs/QmdtKd5Q7tebdo6rXfZed4kN6DXmErRQHJ4PsNCtca9GbB/Prelude/Natural/even
25722572
-- > {-
25732573
-- > Returns `True` if a number if even and returns `False` otherwise
25742574
-- >
@@ -2589,7 +2589,7 @@ import Dhall
25892589
-- using local relative paths instead of URLs. For example, you can use @wget@,
25902590
-- like this:
25912591
--
2592-
-- > $ wget -np -nH -r --cut-dirs=2 https://ipfs.io/ipfs/QmQ8w5PLcsNz56dMvRtq54vbuPe9cNnCCUXAQp6xLc6Ccx/Prelude/
2592+
-- > $ wget -np -nH -r --cut-dirs=2 https://ipfs.io/ipfs/QmdtKd5Q7tebdo6rXfZed4kN6DXmErRQHJ4PsNCtca9GbB/Prelude/
25932593
-- > $ tree Prelude
25942594
-- > Prelude
25952595
-- > ├── Bool
@@ -2653,12 +2653,12 @@ import Dhall
26532653
-- locally like this:
26542654
--
26552655
-- > $ ipfs mount
2656-
-- > $ cd /ipfs/QmQ8w5PLcsNz56dMvRtq54vbuPe9cNnCCUXAQp6xLc6Ccx/Prelude
2656+
-- > $ cd /ipfs/QmdtKd5Q7tebdo6rXfZed4kN6DXmErRQHJ4PsNCtca9GbB/Prelude
26572657
--
26582658
-- Browse the Prelude online to learn more by seeing what functions are
26592659
-- available and reading their inline documentation:
26602660
--
2661-
-- <https://ipfs.io/ipfs/QmQ8w5PLcsNz56dMvRtq54vbuPe9cNnCCUXAQp6xLc6Ccx/Prelude>
2661+
-- <https://ipfs.io/ipfs/QmdtKd5Q7tebdo6rXfZed4kN6DXmErRQHJ4PsNCtca9GbB/Prelude>
26622662
--
26632663
-- __Exercise__: Try to use a new Prelude function that has not been covered
26642664
-- previously in this tutorial
@@ -2667,7 +2667,7 @@ import Dhall
26672667
-- convenience:
26682668
--
26692669
-- > $ dhall
2670-
-- > let Prelude = https://ipfs.io/ipfs/QmQ8w5PLcsNz56dMvRtq54vbuPe9cNnCCUXAQp6xLc6Ccx/Prelude/package.dhall
2670+
-- > let Prelude = https://ipfs.io/ipfs/QmdtKd5Q7tebdo6rXfZed4kN6DXmErRQHJ4PsNCtca9GbB/Prelude/package.dhall
26712671
-- >
26722672
-- > in λ(x : Text)
26732673
-- > → Prelude.`List`.length Text (Prelude.`List`.replicate +10 Text x)
@@ -2682,7 +2682,7 @@ import Dhall
26822682
--
26832683
-- __Exercise__: Browse the Prelude by running:
26842684
--
2685-
-- > $ dhall --pretty <<< 'https://ipfs.io/ipfs/QmQ8w5PLcsNz56dMvRtq54vbuPe9cNnCCUXAQp6xLc6Ccx/Prelude/package.dhall'
2685+
-- > $ dhall --pretty <<< 'https://ipfs.io/ipfs/QmdtKd5Q7tebdo6rXfZed4kN6DXmErRQHJ4PsNCtca9GbB/Prelude/package.dhall'
26862686

26872687
-- $conclusion
26882688
--

0 commit comments

Comments
 (0)