Guinep are small tropical fruits from the Caribbean and Central/Southern America. They are described to taste like a cross between Lime and Lychee.
Automatic UI forms for Scala 3 functions
def upperCaseText(text: String): String =
text.toUpperCase
@main
def run =
guinep.web(upperCaseText)
This will start a local web server with auto generated endpoints for running all listed functions. And an auto generated front-end with a form for each function.
libraryDependencies ++= Seq(
"io.github.kacperfkorban" %% "guinep-web" % "version_from_releases"
)
//> using lib "io.github.kacperfkorban::guinep-web:version_from_releases"
GUInep
only exposes one function guinep.web
which takes some number of functions as arguments.
def upperCaseText(text: String): String =
text.toUpperCase
def rollDice(sides: Int): Int =
scala.util.Random.nextInt(sides) + 1
@main
def run =
guinep.web(
upperCaseText,
rollDice
)
![](https://private-user-images.githubusercontent.com/39772805/310332169-556b6c1b-ea72-4089-8cbd-16f680484177.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ3NzkwODAsIm5iZiI6MTcyNDc3ODc4MCwicGF0aCI6Ii8zOTc3MjgwNS8zMTAzMzIxNjktNTU2YjZjMWItZWE3Mi00MDg5LThjYmQtMTZmNjgwNDg0MTc3LmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI3VDE3MTMwMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWUzNzJmYTUxYWRhM2Q4OGMxNTNkMGRiOTcwMDIyMTg3ZmJjNmFjZTA0MmFlYTlmNzcwNzkyYzA4N2NmMjdhNDMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0._fFKnXm_nYFxJM-dhV5n1AhpsMf8X2QQPVD4Ih5ZHpo)
Currently GUInep doesn't support:
- Functions with multiple parameter lists (and by extension - extension methods) - #33
- Fancier GADTs with unobvious inheritance, type bounds and variance - #30
- Union and intersection types - #44
- Opaque types - #49
If you have any ideas on how to improve GUInep, feel free to open an issue.
All bug reports and feature requests are highly appreciated.