Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

MonadMakers

Guides

  • Monad making

Tech Notes

  • Monad code generation and extension

Symbols

  • AssociationModule
  • GenerateMonadAccessors
  • GenerateMonadDroper
  • GenerateMonadSetter
  • GenerateMonadTaker
  • GenerateStateMonadCode
  • Grid87
  • TraceMonadBind
  • TraceMonadEchoGrid
  • TraceMonad
  • TraceMonadTakeGrid
  • TraceMonadUnit
  • $TraceMonadFailure
AntonAntonov`MonadMakers`
TraceMonad
​
TraceMonad
[]
wrapper monad that allows documentation and tracing of monadic pipeline operations
​
Examples  
(1)
Basic Examples  
(1)
Generate a software monad with the prefix "Perhaps":
In[1]:=
GenerateStateMonadCode
["Perhaps"]
Make a monadic pipeline with the monad tracer that shows the changes of pipeline's value and tabulates pipeline's operations with corresponding descriptions:
In[2]:=
SeedRandom[332];​​
TraceMonadUnit
[PerhapsUnit[RandomInteger[10,15]]]⟹"lift to monad"⟹​​TraceMonadEchoContext⟹​​PerhapsEcho⟹"display current value"⟹​​PerhapsWhen[#〚3〛>3&,PerhapsEchoFunctionValue[Style[#,Red]&]]⟹"display pipeline's value if the 3d element is greater than 3"⟹​​(PerhapsUnit[#/4]&)⟹"replace the pipeline object"⟹​​PerhapsEcho⟹"display current value again"⟹​​
TraceMonadEchoGrid

Grid87
;
»
context:dataPerhapsUnit[RandomInteger[10,15]],binderDoubleLongRightArrow,commands{},comments{lift to monad},contextKeys{{}}
»
Perhaps[{8,5,5,7,0,9,3,10,8,9,1,0,10,9,10},]
»
{8,5,5,7,0,9,3,10,8,9,1,0,10,9,10}
»
Perhaps2,
5
4
,
5
4
,
7
4
,0,
9
4
,
3
4
,
5
2
,2,
9
4
,
1
4
,0,
5
2
,
9
4
,
5
2
,
»
PerhapsUnit[RandomInteger[10,15]]
⟹
lift to monad
PerhapsEcho
⟹
display current value
PerhapsWhen[#1〚3〛>3&,PerhapsEchoFunctionValue[Style[#1,Red]&]]
⟹
display pipeline's value if the 3d element is greater than 3
PerhapsUnit
#1
4
&
⟹
replace the pipeline object
PerhapsEcho
display current value again
SeeAlso
Grid87
 
▪
GenerateStateMonadCode
RelatedGuides
▪
Monad making
""

© 2025 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com