Abstract
Observing intermediate values helps to understand what is going on when your program runs. Gill presented an observation method for lazy functional languages that preserves the program’s semantics. However, users need to define for each type how its values are observed: a laborious task and strictness of the program can easily be affected. Here we define how any value can be observed based on the structure of its type by applying generic programming frameworks. Furthermore we present an extension to specify per observation point how much to observe of a value. We discuss especially functional values and behaviour based on class membership in generic programming frameworks.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
ACM SIGPLAN Workshop on Haskell
Braßel, B., Chitil, O., Hanus, M., Huch, F.: Observing functional logic computations. In: Jayaraman, B. (ed.) PADL 2004. LNCS, vol. 3057, pp. 193–208. Springer, Heidelberg (2004)
Chitil, O., Runciman, C., Wallace, M.: Freja, hat and hood - a comparative evaluation of three systems for tracing and debugging lazy functional programs. In: Mohnen, M., Koopman, P. (eds.) IFL 2000. LNCS, vol. 2011, pp. 176–193. Springer, Heidelberg (2001)
Hinze, R.: Generics for the masses. In: Proceedings of the International Conference on Functional Programming. ACM Press (2004)
Gibbons, J.: Comparing approaches to generic programming in haskell. In: Backhouse, R., Gibbons, J., Hinze, R., Jeuring, J. (eds.) SSDGP 2006. LNCS, vol. 4719, pp. 72–149. Springer, Heidelberg (2007)
Hinze, R., Löh, A.: “Scrap your boilerplate” revolutions. In: Uustalu, T. (ed.) MPC 2006. LNCS, vol. 4014, pp. 180–208. Springer, Heidelberg (2006)
Jansson, P., Jeuring, J.: PolyP – a polytypic programming language extension. In: Proceedings of the Symposium on Principles of Programming Languages. ACM Press (1997)
Jones, M.P., Reid, A.: The Yale Haskell Group, and the OGI School of Science & Engineering. The Hugs 98 User’s Guide (1994–2004). http://www.haskell.org/haskellwiki/Hugs
Kiselyov, O.: Smash your boilerplate without class and typeable (2006). http://article.gmane.org/gmane.comp.lang.haskell.general/14086
Lämmel, R., Peyton Jones, S.: Scrap your boilerplate: a practical design pattern for generic programming. In: ACM SIGPLAN Workshop on Types in Language Design and Implementation. ACM Press (2003)
Lämmel, R., Peyton Jones, S.: Scrap more boilerplate: reflection, zips, and generalised casts. In: Proceedings of the International Conference on Functional Programming. ACM Press (2004)
Lämmel, R., Peyton Jones, S.: Scrap your boilerplate with class: extensible generic functions. In: Proceedings of the International Conference on Functional Programming. ACM Press (2005)
Lämmel, R., Visser, J.: A strafunski application letter. In: Dahl, V. (ed.) PADL 2003. LNCS, vol. 2562, pp. 357–375. Springer, Heidelberg (2002)
Magalhães, J.P., Dijkstra, A., Jeuring, J., Löh, A.: A generic deriving mechanism for haskell. In: Proceedings of the Symposium on Haskell. ACM Press (2010)
Mitchell, N., Runciman, C.: Uniform boilerplate and list processing. In: Proceedings of the Haskell Workshop. ACM Press (2007)
Nilsson, H.: Declarative debugging for lazy functional languages. PhD thesis, Linköpings universitet (1998)
Oliveira, B.C.D.S., Hinze, R., Löh, A.: Extensible and modular generics for the masses. In: Proceedings of Trends in Functional Programming. Elsevier (2006)
Pope, B.: Declarative debugging with buddha. In: Vene, V., Uustalu, T. (eds.) AFP 2004. LNCS, vol. 3622, pp. 273–308. Springer, Heidelberg (2005)
Reinke, C.: GHood - graphical visualisation and animation of haskell object observations. In: Proceedings of the Haskell Workshop (2001)
Rodriguez, A., Jeuring, J., Jansson, P., Gerdes, A., Kiselyov, O., Oliveira, B.C.D.S.: Comparing libraries for generic programming in haskell. In: Proceedings of the Symposium on Haskell. ACM Press (2008)
Sheard, T., Peyton Jones, S.: Template meta-programming for haskell. In: Proceedings of the Workshop on Haskell. ACM Press (2002)
Wallace, M., Chitil, O., Brehm, T., Runciman, C.: Multiple-view tracing for haskell: a new hat. In: Proceedings of the 2001 ACM SIGPLAN Haskell Workshop (2001)
Winstanley, N., Meacham, J.: DrIFT Manual (2008). http://repetae.net/computer/haskell/DrIFT/drift.html
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2015 Springer International Publishing Switzerland
About this paper
Cite this paper
Faddegon, M., Chitil, O. (2015). Type Generic Observing. In: Hage, J., McCarthy, J. (eds) Trends in Functional Programming. TFP 2014. Lecture Notes in Computer Science(), vol 8843. Springer, Cham. https://doi.org/10.1007/978-3-319-14675-1_6
Download citation
DOI: https://doi.org/10.1007/978-3-319-14675-1_6
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-14674-4
Online ISBN: 978-3-319-14675-1
eBook Packages: Computer ScienceComputer Science (R0)