Skip to content

Instantly share code, notes, and snippets.

View nirav-tukadiya's full-sized avatar
🎯
Focusing

Nirav Tukadiya nirav-tukadiya

🎯
Focusing
View GitHub Profile

Unlocking the Full Potential of Kotlin with Arrow.kt: The Key to Concise, Expressive, and Safe Functional Programming in Android

Photo by Yafiu Ibrahim on Unsplash

Introduction:

Functional programming has become increasingly popular in recent years, with libraries like Arrow.kt making it more accessible to developers in Kotlin. Arrow.kt is a functional programming library for Kotlin that provides tools for working with functional programming concepts such as immutability, higher-order functions, and algebraic data types. This blog post will guide you through setting up Arrow.kt in an Android project and provide practical examples of the top 10 most used features of the library.

Setup:

Why You Should Consider Migrating Your Gradle Scripts to Kotlin DSL

Gradle Kotlin DSL (Domain Specific Language) is a Kotlin-based language used to configure Gradle builds. It provides a more concise and type-safe way to define build scripts compared to the traditional Groovy-based Gradle scripts.

Gradle Kotlin DSL was introduced to solve some of the challenges associated with Gradle Groovy-based scripts, such as the lack of static typing and code completion, as well as the difficulty of maintaining complex build scripts. With Gradle Kotlin DSL, build scripts become more maintainable, easier to read, and less prone to errors.

Benefits of using Gradle Kotlin DSL:

@nirav-tukadiya
nirav-tukadiya / animations & drawables
Last active October 28, 2020 11:41
slice Assignment animations
Animations
- loading
- search
- twitter
Drawables
- Twitter logo
- Fav icon
- RT icon
- Search icon
@nirav-tukadiya
nirav-tukadiya / AppDelegate.swift
Created June 24, 2019 12:57
AppDelegate for AFEiOS
//
// AppDelegate.swift
// AFEiOS
//
// Created by NIRAV on 24/06/19.
// Copyright © 2019 NIRAV. All rights reserved.
//
import UIKit
import Flutter
@nirav-tukadiya
nirav-tukadiya / ViewController.swift
Created June 24, 2019 10:53
Main ViewController for AFEiOS app
//
// ViewController.swift
// AFEiOS
//
// Created by NIRAV on 24/06/19.
// Copyright © 2019 NIRAV. All rights reserved.
//
import UIKit
@nirav-tukadiya
nirav-tukadiya / FlutterViewActivity.kt
Created June 20, 2019 13:54
FlutterViewActivity loads the view from AFE_Flutter module.
package `in`.androidgeek.afe
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.widget.FrameLayout
import io.flutter.facade.Flutter
@nirav-tukadiya
nirav-tukadiya / main.dart
Created June 20, 2019 12:33
Main file for AFE_Flutter module.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'AFE Flutter',
@nirav-tukadiya
nirav-tukadiya / InputNumbersActivity.kt
Last active June 20, 2019 12:33
Main Activity for AFE_Android module
package `in`.androidgeek.afe
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.widget.Toast
import kotlinx.android.synthetic.main.activity_input_numbers.*
class InputNumbersActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {