Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Software
Mock
Commits
6c14bb8b
Commit
6c14bb8b
authored
Dec 01, 2018
by
Nicolas Lenz
Browse files
Fix
#5
: Implement square style
parent
527141fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Mock.hs
View file @
6c14bb8b
...
...
@@ -23,7 +23,8 @@ styles = [
(
"lower"
,
T
.
toLower
),
(
"double"
,
T
.
map
toDouble
),
(
"cc"
,
mockCC
),
(
"b"
,
mockB
)]
(
"b"
,
mockB
),
(
"square"
,
mockSquare
)]
-- |Transforms a String into uppercase where the corresponding list is True. For False the String isn't changed.
toUpperBy
::
[
Bool
]
->
T
.
Text
->
T
.
Text
...
...
@@ -66,3 +67,7 @@ mockCC = T.replace "k" "cc" . T.replace "ck" "cc"
-- |Repaclaces all occurences of "b" and "B" with B button emojis.
mockB
::
Text
->
Text
mockB
=
T
.
replace
"b"
"🅱️"
.
T
.
replace
"B"
"🅱️"
-- |Makes a square from a string.
mockSquare
::
Text
->
Text
mockSquare
text
=
T
.
concat
[
T
.
intersperse
' '
text
,
"
\n
"
,
T
.
intercalate
"
\n
"
(
T
.
chunksOf
1
text
)]
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment