- Learning Scala Programming
- Vikash Sharma
- 129字
- 2021-06-30 19:07:50
Function literals
Function literals are a syntactical way of representing a function. The basic structure of a function is something that can take some parameters and return a response. If we've to represent a function that takes an Int value and respond in String, it will be like this:
Int => String
The left-hand side represents the input parameters, and the right-hand side gives parameters that are response type. The type of preceding function literal is Function1[Int, String], and parameters Int and String are representing input and output parameters respectively. We'll discuss these more when we talk about functions in subsequent chapters.
We have discussed how literals are represented in Scala, and now that we know this, we've got a heads up to go ahead with data types.
- Learning Real-time Processing with Spark Streaming
- Hands-On Machine Learning with scikit:learn and Scientific Python Toolkits
- Cassandra Data Modeling and Analysis
- 名師講壇:Java微服務架構(gòu)實戰(zhàn)(SpringBoot+SpringCloud+Docker+RabbitMQ)
- HTML5+CSS3網(wǎng)頁設計
- Java面向?qū)ο蟪绦蛟O計
- Java網(wǎng)絡編程核心技術詳解(視頻微課版)
- App Inventor 2 Essentials
- DevOps 精要:業(yè)務視角
- Unity 5 Game Optimization
- 優(yōu)化驅(qū)動的設計方法
- Python量子計算實踐:基于Qiskit和IBM Quantum Experience平臺
- JSP編程教程
- Building an E-Commerce Application with MEAN
- Getting Started with SQL Server 2014 Administration