Skip to main content

Dynamic Editors for Well-Typed Expressions

  • Conference paper
  • First Online:
Trends in Functional Programming (TFP 2021)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 12834))

Included in the following conference series:

Abstract

Interactive systems may require complex inputs. Domain experts prefer guidance in the construction of these inputs. An ideal system prevents errors and is flexible in the construction and changes of its input. The iTask system generates web-editors given any first-order algebraic data types. The generated web-editors are useful but have their limitations. It is not possible to combine type safety with overloaded operators and preventing unbounded or ill-typed identifiers is impossible. Using phantom types, generalized algebraic datatypes or functions solves the language problems, but they cannot be handled by the datatype generic system. Moreover, changing expressions can require re-entering large parts of the input. We present dynamic editors that can solve all those problems. The programmer specifies the elements of such an editor by functions. The system shows the applicable edit elements in a drop-down menu to the user. The dynamic editor is used recursively to create the arguments for the selected function. Dynamic editors are seamlessly integrated with the ordinary web-editors of the iTask system. The obtained editors guide the users to make correct and type-safe inputs. These editors can be very flexible as well without making strange abstract syntax trees.

Research Paper.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 34.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 44.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Actually these elements are abbreviations of slightly more general items in the library. The items in the library allow different tags and names displayed. This can be convenient, but it is more verbose and we do not need this additional flexibility here.

    figure av
  2. 2.

    We used some CCS annotations to obtain horizontal layout and grey boxes to group elements. Since we focus on correctness we do not discuss this fine-tuning of editors in this paper. We show the default layout offered by the system and do not spent any effort in beautifying its appearance. For real-world application polishing the interface is important.

  3. 3.

    Without such a datatype the dynamic editor will go into the recursion to make editors for the arguments of the comparison function.

  4. 4.

    For pretty-printing of the expressions it might be necessary to add the name of the operation. We omit it to keep the example as small as possible.

  5. 5.

    If Clean would have a GADT extension like Haskell this type could be specified as:

    figure ec
  6. 6.

    We have dropped operators with similar types to the listed constructors to safe space.

  7. 7.

    Due to space limitations we list only the interesting clauses here. Alternatives that are very similar to the one listed here are omitted.

References

  1. Achten, P., Alimarine, A., Plasmeijer, R.: When generic functions use dynamic values. In: Peña, R., Arts, T. (eds.) IFL 2002. LNCS, vol. 2670, pp. 17–33. Springer, Heidelberg (2001). https://doi.org/10.1007/3-540-44854-3_2

    Chapter  Google Scholar 

  2. Achten, P., Koopman, P., Plasmeijer, R.: An introduction to task oriented programming. In: Zsók, V., Horváth, Z., Csató, L. (eds.) CEFP 2013. LNCS, vol. 8606, pp. 187–245. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-15940-9_5

    Chapter  Google Scholar 

  3. Achten, P.: Clean for Haskell98 programmers - a quick reference guide, July 13 2007. http://www.mbsd.cs.ru.nl/publications/papers/2007/achp2007-CleanHaskellQuickGuide.pdf

  4. Alimarine, A., Plasmeijer, R.: A generic programming extension for clean. In: Arts, T., Mohnen, M. (eds.) IFL 2001. LNCS, vol. 2312, pp. 168–185. Springer, Heidelberg (2002). https://doi.org/10.1007/3-540-46028-4_11

    Chapter  Google Scholar 

  5. Cheney, J., Hinze, R.: A lightweight implementation of generics and dynamics. In: Proceedings of the 2002 ACM SIGPLAN Haskell Workshop, June 2004

    Google Scholar 

  6. Gordon, A., Peyton Johnes, S.: LAMBDA: the ultimate excel worksheet function (2021). https://www.microsoft.com/en-us/research/blog/lambda-the-ultimatae-excel-worksheet-function/

  7. HaskellWiki: Applications and libraries/GUI libraries – HaskellWiki (2019). https://wiki.haskell.org/index.php?title=Applications_and_libraries/GUI_libraries&oldid=63014. Accessed 6 Apr 2020

  8. Hinze, R.: Memo functions, polytypically! In: Proceedings of the 2nd Workshop on Generic Programming, Ponte de, pp. 17–32 (2000)

    Google Scholar 

  9. Hughes, J.: Restricted data types in Haskell. In: Proceedings of the 1999 Haskell Workshop (1999)

    Google Scholar 

  10. Jones, W., Field, T., Allwood, T.: Deconstraining dsls (2012). https://doi.org/10.1145/2364527.2364571

  11. Mestanogullari, A., Hahn, S., Arni, J.K., Löh, A.: Type-level web APIs with servant: an exercise in domain-specific generic programming. In: Proceedings of the 11th ACM SIGPLAN Workshop on Generic Programming, pp. 1–12. ACM (2015)

    Google Scholar 

  12. Omar, C., Voysey, I., Hilton, M., Aldrich, J., Hammer, M.A.: Hazelnut: a bidirectionally typed structure editor calculus. SIGPLAN Not. 52(1), 86–99 (2017). https://doi.org/10.1145/3093333.3009900

    Article  MATH  Google Scholar 

  13. Pil, M.: Dynamic types and type dependent functions. In: Hammond, K., Davie, T., Clack, C. (eds.) IFL 1998. LNCS, vol. 1595, pp. 169–185. Springer, Heidelberg (1999). https://doi.org/10.1007/3-540-48515-5_11

    Chapter  Google Scholar 

  14. Plasmeijer, R., Lijnse, B., Michels, S., Achten, P., Koopman, P.: Task-oriented programming in a pure functional language. In: Proceedings of the 14th PPDP Symposium, pp. 195–206. ACM (2012). https://doi.org/10.1145/2370776.2370801

  15. Plasmeijer, R., van Eekelen, M.: Clean language report (2012). https://clean.cs.ru.nl/Documentation

  16. Richardson, C., Rymer, J.R.: New development platforms emerge for customer-facing applications (2014). www.forrester.com

  17. Saraiva, J., Swierstra, D.: Generating spreadsheet-like tools from strong attribute grammars. In: Pfenning, F., Smaragdakis, Y. (eds.) Generative Programming and Component Engineering, pp. 307–323 (2003)

    Google Scholar 

  18. Schrijvers, T., Peyton Jones, S., Sulzmann, M., Vytiniotis, D.: Complete and decidable type inference for GADTs. In: Proceedings of the 14th ACM SIGPLAN ICFP, ICFP 2009, pp. 341–352. ACM (2009). https://doi.org/10.1145/1596550.1596599

  19. Snoyman, M.: Developing Web Apps with Haskell and Yesod. O’Reilly Media, Sebastopol (2015)

    Google Scholar 

  20. team, H.: Happstack. happstack.com. Accessed 6 Apr 2020

  21. Vincent, P., Lijjima, K., Driver, M., Wong, J., Natis, Y.: Magic quadrant for enterprise low-code application platforms (2019). www.gartner.com

  22. Wikipedia contributors: Low-code development platform – Wikipedia (2020). https://en.wikipedia.org/w/index.php?title=Low-code_development_platform&oldid=944262991. Accessed 14 Mar 2020

Download references

Acknowledgements

Many thanks to the anonymous referees of this paper and our colleagues from the Radboud university and TOP-software for their feedback and support during this research. The techniques described here are first applied in VIIA that is developed in close collaboration with the Dutch Coastguard.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Pieter Koopman .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2021 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Koopman, P., Michels, S., Plasmeijer, R. (2021). Dynamic Editors for Well-Typed Expressions. In: Zsók, V., Hughes, J. (eds) Trends in Functional Programming. TFP 2021. Lecture Notes in Computer Science(), vol 12834. Springer, Cham. https://doi.org/10.1007/978-3-030-83978-9_3

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-83978-9_3

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-83977-2

  • Online ISBN: 978-3-030-83978-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics