Skip to content

Commit 0ff1050

Browse files
Update gh-pages
Store path: /nix/store/8fpj6gyqn5w5gdgmlcb402arv7n46yv0-lambda-buffers-book
1 parent ea793b2 commit 0ff1050

File tree

15 files changed

+830
-541
lines changed

15 files changed

+830
-541
lines changed

book.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -557,9 +557,9 @@ aria-label="Show hidden lines"></button>';
557557
sidebarToggleAnchor.addEventListener('change', function sidebarToggle() {
558558
if (sidebarToggleAnchor.checked) {
559559
const current_width = parseInt(
560-
document.documentElement.style.getPropertyValue('--sidebar-width'), 10);
560+
document.documentElement.style.getPropertyValue('--sidebar-target-width'), 10);
561561
if (current_width < 150) {
562-
document.documentElement.style.setProperty('--sidebar-width', '150px');
562+
document.documentElement.style.setProperty('--sidebar-target-width', '150px');
563563
}
564564
showSidebar();
565565
} else {
@@ -583,7 +583,7 @@ aria-label="Show hidden lines"></button>';
583583
showSidebar();
584584
}
585585
pos = Math.min(pos, window.innerWidth - 100);
586-
document.documentElement.style.setProperty('--sidebar-width', pos + 'px');
586+
document.documentElement.style.setProperty('--sidebar-target-width', pos + 'px');
587587
}
588588
}
589589
//on mouseup remove windows functions mousemove & mouseup

css/variables.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
/* Globals */
33

44
:root {
5-
--sidebar-width: 300px;
5+
--sidebar-target-width: 300px;
6+
--sidebar-width: min(var(--sidebar-target-width), 80vw);
67
--sidebar-resize-indicator-width: 8px;
78
--sidebar-resize-indicator-space: 2px;
89
--page-padding: 15px;

plutarch/app/Example.hs

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ import Plutarch.Internal.Term (
2424
import Plutarch.LedgerApi.V1 (PCurrencySymbol (PCurrencySymbol), PTokenName (PTokenName), pposixTime)
2525
import Plutarch.LedgerApi.Value (PAssetClass (PAssetClass))
2626
import Plutarch.Maybe qualified as Scott
27-
import Plutarch.Prelude (ClosedTerm, PAsData, PBool (PFalse, PTrue), PBuiltinList, PByteString, PDataNewtype (PDataNewtype), PEq ((#==)), PIsData, PlutusType, Term, pcon, pconstant, pdata, perror, pfind, pfromData, pif, plam, pletC, pmatch, pmatchC, ppairDataBuiltin, pshow, ptraceInfo, unTermCont, (#), (#&&), (:-->))
27+
import Plutarch.Prelude (ClosedTerm, PAsData, PBool (PFalse, PTrue), PBuiltinList, PByteString, PEq ((#==)), PIsData, PlutusType, Term, pcon, pconstant, pdata, perror, pfind, pfromData, pif, plam, pletC, pmatch, pmatchC, ppairDataBuiltin, pshow, ptraceInfo, unTermCont, (#), (#&&), (:-->))
2828

2929
userRef :: Text -> Term s (Ref User)
30-
userRef userName = userRef' (pfromData $ name userName)
30+
userRef userName = userRef' (textToBytes userName)
3131

3232
userRef' :: Term s Bytes -> Term s (Ref User)
3333
userRef' userName = pcon $ Ref (pdata (userRefAssetClass userName))
@@ -36,24 +36,17 @@ userRefAssetClass :: Term s Bytes -> Term s PAssetClass
3636
userRefAssetClass userName =
3737
pcon $
3838
PAssetClass
39-
( pcon $
40-
PDataNewtype
41-
( pdata $
42-
ppairDataBuiltin
43-
# pcon' (PCurrencySymbol $ pcon $ PDataNewtype $ name "users")
44-
# pcon' (PTokenName $ pcon $ PDataNewtype $ pdata userName)
45-
)
39+
( ppairDataBuiltin
40+
# pcon' (PCurrencySymbol $ textToBytes "users")
41+
# pcon' (PTokenName userName)
4642
)
4743

4844
activeUser :: Text -> [Term s (Ref User)] -> Integer -> Term s User
49-
activeUser n friends since = pcon $ User (name n) (pdata $ activeSince since) (pdata $ Lb.plistFrom friends)
45+
activeUser n friends since = pcon $ User (pdata $ textToBytes n) (pdata $ activeSince since) (pdata $ Lb.plistFrom friends)
5046

5147
activeSince :: Integer -> Term s Status
5248
activeSince since = pcon (Status'Active (pdata (pposixTime (pconstantInteger since))))
5349

54-
name :: Text -> Term s (PAsData PByteString)
55-
name = textToBytes
56-
5750
message :: Term s POSIXTime -> Term s (Ref User) -> Term s (Ref User) -> Term s Content -> Term s Message
5851
message at from to content = pcon $ Message (pdata at) (pdata from) (pdata to) (pdata content)
5952

@@ -68,7 +61,7 @@ isFriendly = plam $ \users msg -> unTermCont $ do
6861
pif
6962
( (isFriend # fromFriends # toName)
7063
#== (isFriend # toFriends # fromName)
71-
#&& (content #== pcon' (Content'Text (textToBytes "'sup")))
64+
#&& (content #== pcon' (Content'Text (pdata $ textToBytes "'sup")))
7265
)
7366
(pcon PTrue)
7467
(ptraceInfo ("This wasn't a friendly message :(" <> pshow msg) perror)
@@ -102,8 +95,8 @@ isFriendly = plam $ \users msg -> unTermCont $ do
10295
pcon' :: PIsData a => PlutusType a => a s -> Term s (PAsData a)
10396
pcon' = pdata . pcon
10497

105-
textToBytes :: Text -> Term s (PAsData PByteString)
106-
textToBytes = pdata . pconstant . Text.encodeUtf8
98+
textToBytes :: Text -> Term s PByteString
99+
textToBytes = pconstant . Text.encodeUtf8
107100

108101
toBuiltinList :: Term s (Lb.PList a :--> PBuiltinList (PAsData a))
109102
toBuiltinList = plam $ \xs -> pmatch xs (\(Lb.PList xs') -> xs')
@@ -127,7 +120,7 @@ jared :: Term s User
127120
jared = activeUser "Jared Pon" [userRef "Gergely Szabó", userRef "Drazen Popovic"] 2
128121

129122
supJaredSaidGergo :: Term s Message
130-
supJaredSaidGergo = message (pposixTime (pconstantInteger 10)) (userRef "Gergely Szabó") (userRef "Jared Pon") (pcon $ Content'Text (textToBytes "'sup"))
123+
supJaredSaidGergo = message (pposixTime (pconstantInteger 10)) (userRef "Gergely Szabó") (userRef "Jared Pon") (pcon $ Content'Text (pdata $ textToBytes "'sup"))
131124

132125
main :: IO ()
133126
main = evalBool $ isFriendly # Lb.plistFrom [drazen, gergo, jared] # supJaredSaidGergo

plutarch/build.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
in
2929

3030
{
31-
devShells.dev-plutarch-example = hsFlake.devShell;
31+
devShells.dev-plutarch-example = hsFlake.devShells.default;
3232

3333
packages = {
3434
plutarch-example-cli = hsFlake.packages."plutarch-example:exe:plutarch-example";

plutarch/cabal.project

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
packages: ./.
22

33
tests: true
4+
5+
allow-newer:
6+
-- TODO(szg251): Allow once the below issue is resolved
7+
-- https://github.com/phadej/vec/issues/121
8+
ral:QuickCheck,
9+
fin:QuickCheck,
10+
bin:QuickCheck,

plutustx/build.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
in
3535

3636
{
37-
devShells.dev-plutustx-example = hsFlake.devShell;
37+
devShells.dev-plutustx-example = hsFlake.devShells.default;
3838

3939
packages = {
4040
# Derivation for the .lbf schema file

searcher.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/* global Mark, elasticlunr, path_to_root */
44

55
window.search = window.search || {};
6-
(function search(search) {
6+
(function search() {
77
// Search functionality
88
//
99
// You can use !hasFocus() to prevent keyhandling in your key
@@ -29,7 +29,8 @@ window.search = window.search || {};
2929
searchicon = document.getElementById('search-toggle'),
3030
content = document.getElementById('content'),
3131

32-
mark_exclude = [],
32+
// SVG text elements don't render if inside a <mark> tag.
33+
mark_exclude = ['text'],
3334
marker = new Mark(content),
3435
URL_SEARCH_PARAM = 'search',
3536
URL_MARK_PARAM = 'highlight',
@@ -288,6 +289,9 @@ window.search = window.search || {};
288289

289290
// If reloaded, do the search or mark again, depending on the current url parameters
290291
doSearchOrMarkFromUrl();
292+
293+
// Exported functions
294+
config.hasFocus = hasFocus;
291295
}
292296

293297
function unfocusSearchbar() {
@@ -521,6 +525,4 @@ window.search = window.search || {};
521525

522526
loadScript(path_to_root + 'searchindex.js', 'search-index');
523527

524-
// Exported functions
525-
search.hasFocus = hasFocus;
526528
})(window.search);

searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

toc.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

typescript-plutus/.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake .#plutus-sample-project-typescript

0 commit comments

Comments
 (0)